PDA

View Full Version : Validating the Phone Number with an Extension


webmaster359615
03-30-2009, 02:30 AM
I have been working on customizing the users_Registration.php form. While not easy (there are a lot of things to adjust with every change), I have been successful with most of it so far.

One thing I have had difficulty with is customizing the Phone Number field so it takes an Extension.

Does anyone know of adjustments to the pattern or other coding that would accomplish this?

I also noticed that, with the default settings, a user could type in an Extension, and as long as it did not go over the maxChars setting, it would get a green light on blur. But on submit, it would receive an red server error.

Ray Borduin
03-30-2009, 08:15 AM
This means that your spry client validation is not failing, but your server validation is. Since they do not directly correlate, sometimes something can pass client validation and fail on the server.

To fix the problem you would probably update the code on top of the page and change the server validation from phone number, which is very strict, to something like entry length or alphanumeric, or even regular expression pattern validation which can be made more flexible to meet your specific needs.