| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Validate US/CA Phone Number Format | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Validate US/CA Phone Number Format
The one problem I noticed rather quickly with X-Cart when it came to the required fields for the customer information input form (checking out / account registration) is that when it checks certain fields, like the phone number, it only checks the length. Now this is a big problem especially for us when we deal with Canadian orders because we have to verify certain things over the phone.
Normally this isn't an issue if the customer uses PayPal Pro Express Checkout as the payment method since they require a phone number but if they use our other payment method they get around the phone number by putting in some arbitrary character. To solve this I made a modification I wish to share with anyone wishing to do this. This modification adds an extra check in the script check_required_fields_js.js and is easy to make. Open skin1/required_fields_js.js and on line 40 (assuming you have not modified this already), add the following: Code:
If you have modified the file this conditional block must go after: Code:
This will work with any input field that has the ID of phone and will force the customer to provide a phone number (unless they've disabled javascript, which requires server-side intervention which I will include later on in this post). |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Validate US/CA Phone Number Format
What version is the for? In 4.1.x, I think it's skin1/check_required_fields_js.js not skin1/required_fields_js.js
__________________
Jack@AquasanaCA X-CART GOLD 4.0.19 Live DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America! X-CART GOLD 4.4.5 Live CDSEO Pro v. 1.8.4 AquasanaMontreal.com Aquasana╝ & Rhino Water Filtration Systems |
|||||||||
|
|||
X-Cart forums © 2001-2020
|