Formatting/Validation option for phone & email fields

Is it possible to add phone number formatting option so that users phone inputs are consistent and accurate? This is super helpful for CRM applications and would ensure that country codes and phone numbers are correctly entered. There are already a few libraries for this purpose which hopefully can be adopted.

I was also wondering if email and URL fields could have an option of formatting input into lowercase. It would be creator selectable and would help those with OCD maintain consistency :slight_smile:

1 Like

I agree that a phone or email format should inherrently mean some validation checks, particularly in form view where it is exposed to the public; otherwise in the UI, it is just a text field that can link to its value (tel: or mailto:), and optionally has a button display.

As for this, I do not see it as a good idea, since parts of URLs and email addresses, by RFC Standards are allowed to be case-sensitive (though most servers implement them fully case-insensitively). In other words, theoretically an email address or URL could break if the case is changed, though in practise this would be highly improbable.

The format would need to be thought out. Formats are different in different countries. Do we use full number with country code and + sign, like +15555555555? Or USA format (555) 555-5555? Or where I live the format is 0555 555 555. I agree that formatting is nice, but it would be helpful to clarify what formats we are talking about.

I agree, though the issue here is not formatting, but validation. To begin with, it could something basic like very forgiving/permissive regular expressions, to at least ensure something close to a valid email or phone number is input, without blocking non-standard user inputs.

As a more developed feature, it would be nice to allow architects to use formulas for validations, where we could set up our own regular expressions, or other logic.