I've got a very simple contact form set up. I'm trying to use regex to validate a 10-digit US phone number in the format: 555-555-5555
I entered my regex into the regex field: ^[0-9]{3}\-[0-9]{3}\-[0-9]{4}$
Now, when using the form the field turns red as expected when typing, then back to white once the number is correctly filled.
However, when pressing submit, the validation fails and the error message is displayed to enter the number in the correct format.
What gives? I assume I have missed some option in the validation panel.
[file=13398]Untitled-1.jpg[/file]
I entered my regex into the regex field: ^[0-9]{3}\-[0-9]{3}\-[0-9]{4}$
Now, when using the form the field turns red as expected when typing, then back to white once the number is correctly filled.
However, when pressing submit, the validation fails and the error message is displayed to enter the number in the correct format.
What gives? I assume I have missed some option in the validation panel.

if your form is simple then you may install v7 and rebuild your form, here is a video on Regex validation:
https://www.youtube.com/watch?v=yK6CYsrMw3Y&list=PLNdPw6Bog3zcuSKs7NGNi8QPtfj5IsxQA&index=7&t=7s
and you may also use the field mask to force a specific format!
https://www.youtube.com/watch?v=yK6CYsrMw3Y&list=PLNdPw6Bog3zcuSKs7NGNi8QPtfj5IsxQA&index=7&t=7s
and you may also use the field mask to force a specific format!
"Redo all your forms" isn't really the answer I was hoping for.
In any case, I was able to sort it out on my own.
The solution was two part:
In any case, I was able to sort it out on my own.
The solution was two part:
- Use leading and trailing frontslashes on the regex, like: /^[0-9]{3}\-[0-9]{3}\-[0-9]{4}$/
- In the Setting tab, make sure the form is set to the V6.1 type
I was saying just rebuild this form!🙂
You need to login to be able to post a reply.