Forum Discussion

SergioSergio's avatar
SergioSergio
Qrew Cadet
8 years ago

Can I use any of this HTML formulas to format the text field for phone numbers?

I found a website with some formulas that format the phone number to be imputed in a especific format. I dont see to be able to use it on the text formula field.

Can someone please help?

This are the formula, and this is the website with the formulas for phone numbers and dates.

\d{3}[\-]\d{3}[\-]\d{4}
http://html5pattern.com/Phones#n=Name%E2%80%A6&p=Pattern%E2%80%A6&d=Description%E2%80%A6&...
  • The expression you entered is called "regular expression" and it technically represents the description of the pattern of characters that constitute a valid US phone number. There is no provision to use regular expressions in the QuickBase formula language or form rules. You can however use regular expressions with JavaScript to validate a field. However to do this you need to set up a JavaScript injection technique such as the IOL techinique. to get the JavaScript into the form in the first place. Additionally, you need to decide what feedback you want to provide to the user as the JavaScript can detect and report errors in the phone number (1) on a key-by-key basis, (2) when the field blurs, or (3) when the form is about to submit. Any of this is possible but you have to use script.
  • Thank you so much.
    I guess i need more Knowledge in how to do that. I just know some basics in quickbase like creating url fields, buttons and etc. Is there any tips how I can learn to do this so I can use all your codes in the pastie?