I have used the "data format" section to select the phone number format but that seems to be for display only.
How can the user be forced to use the input format ( 0# #### #### ) as a condition. The phone number is not required but if the user attempts to fill in the phone number field the formatting takes over and must be used.
Barry
format phone number input
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: format phone number input
Hi,
you can add a pattern to the input field.
e.g.
$j('#field').attr("pattern", '0[0-9] [0-9]{4} [0-9]{4}');
you can add a pattern to the input field.
e.g.
$j('#field').attr("pattern", '0[0-9] [0-9]{4} [0-9]{4}');
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: format phone number input
Thank you I will give it a try