Is there a way to remove the leading zero in a phone number when submitting a simple form? The form has a server connect to mailer to send out an email and I need to include the POST value of the phone number without a leading zero, like mobile number from ‘0400200300’ to submit as ‘400200300’
There is no direct formatter to do this in Wappler from what I know.
An elaborate method would be to do a substring (0,1) to get the first character, check if its a 0, and if it is, substring the value again from (1, length-of-value - 1).
Or, you can write your own custom TRIM formatter which accepts a param for which character to trim.
If you know the numbers are as in your example - ie with no spaces - I think you could just use .toNumber() to remove the leading zero. To remove spaces, as well as the leading zero, you could use the replace formatter, eg: phoneNumber.value.replace(' ', '').toNumber().
@sid’s approach would allow spaces to be preserved.
Clicking the magic wand icon brings up exactly the formatter as shown on your screenshot … right click your value and select the formatting option you need.