![]() |
Phone Number Validation |
Post Reply ![]() |
Author | |
Kevin Markle ![]() Newbie ![]() Joined: 25-May-2011 Location: Rochester Hills Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 25-May-2011 at 3:34pm |
In the onepagecheckoutJS.asp program (ProductCart v4), how can I validate the billing phone number beyond setting it to: required and minlength(10)? I'm trying to achieve a phone number in the following format: xxx-xxx-xxxx. This implies a mimimum of 10 numbers with a possible addition of blanks or dashes. Users could add additional digits for an extension or international phone numbers. The phone number field should never be able to accept: "phonenumber" as a valid phone number. However, it currently meets the required condition and minimum length of field.
Thanks again for any help in advance.
Kevin Markle
|
|
![]() |
|
ProductCart ![]() Admin Group ![]() ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
![]() ![]() ![]() ![]() ![]() |
Hi Kevin,
phone number validation is very tricky as people enter phone numbers in all kinds of ways, especially when it comes to international phone numbers. We decided that it actually makes more sense to accept any string rather than showing validation messages that could frustrate a customer and make them leave the checkout process. You can always follow-up with a customer after the order has been placed - and before processing it - to request a correct phone number, if one was not entered. You can use the built-in Help Desk for that reason. |
|
![]() |
|
Kevin Markle ![]() Newbie ![]() Joined: 25-May-2011 Location: Rochester Hills Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Thank you for the prompt reply. However, my management insisted on the billing phone field validation. I was successful this afternoon in including a modified version of the phoneUS jquery construct (.* at the end of the validation to accept additional characters) in the onepagecheckoutJS.asp program. Now the billing phone number field accepts any 10 digit phone number with any additional characters at the end of the string. However, characters cannnot be in the first 12 digits (e.g. "phonenumber" now fails) and xxx-xxx-xxxx ext. 321 (is correctly accepted).
|
|
![]() |
|
Kevin Markle ![]() Newbie ![]() Joined: 25-May-2011 Location: Rochester Hills Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
This morning I had to back off the phoneUS validation. Although the jquery construct worked fine in my environment (IE8), selected external users found themselves in an infinite loop and could not continue through the checkout process. The construct also did not work successfully in IE9. However, I currently do not have a good understanding of why this external construct did not work in all user environments after extensive browser testing.
My final step was to return to field: required and minlength(10) for billing phone number validation.
|
|
![]() |
|
Kevin Markle ![]() Newbie ![]() Joined: 25-May-2011 Location: Rochester Hills Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
I was finally successful in launching the phoneUS jquery construct after finding an extra comma left behind after removing an extra message. The billing phone number validation is working correctly now.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |