Checkout Phone Number Being Entered as "United States"
-
- Posts: 61
- Joined: Wed Jul 28, 2010 7:45 am
- Location: Missouri
Checkout Phone Number Being Entered as "United States"
I'm having a problem come up more and more frequently... where the customers phone number is getting entered as "UNITED STATES". I'm pretty sure this is from an "Auto-fill" situation on phones not reading the field correctly, but I'm really wondering why there doesn't seem to be field validation that the enter is in fact a valid phone number in ----- format?
-
- Posts: 147
- Joined: Wed Nov 09, 2016 11:01 am
Re: Checkout Phone Number Being Entered as "United States"
You could use Javascript to validate and format a phone number. It can get a little complicated once you start factoring in all the possible formats (10-digit US phone numbers, possibly different lengths in other countries, 1 to 3 digit country codes, and also extensions). The simplest route, require the phone number contains at least 10 digits and don't attempt any formatting.
Note: that merchants with ShopSite Pro can use Commerce > Order System > Checkout > 'Javascript added at start of built-in CheckIt function' to do this, but they would have to come up with/add the custom JavaScript themselves. There are probably similar topics on the forum with other users sharing some of their custom solutions, for example:
https://forums.shopsite.com/viewtopic.php?f=1&t=8713&p=22638&hilit=format+phone+number#p22638
Note: that merchants with ShopSite Pro can use Commerce > Order System > Checkout > 'Javascript added at start of built-in CheckIt function' to do this, but they would have to come up with/add the custom JavaScript themselves. There are probably similar topics on the forum with other users sharing some of their custom solutions, for example:
https://forums.shopsite.com/viewtopic.php?f=1&t=8713&p=22638&hilit=format+phone+number#p22638
-
- Posts: 61
- Joined: Wed Jul 28, 2010 7:45 am
- Location: Missouri
Re: Checkout Phone Number Being Entered as "United States"
I guess I'm just really surprised there isn't ANY validation from SS on this.
If anyone is making list of feature requests, this would be a big one... seems like an oversight to me! I wouldn't ever take data on a form without validating it first!
If anyone is making list of feature requests, this would be a big one... seems like an oversight to me! I wouldn't ever take data on a form without validating it first!
-
- Site Admin
- Posts: 318
- Joined: Fri Aug 04, 2006 1:30 pm
- Location: Utah
- Contact:
Re: Checkout Phone Number Being Entered as "United States"
Validating a phone number is a little tricky since the separators could be parenthesis, dashes, periods, spaces. It could include an extension with the abbreviation of EXT or X or something in a foreign language. But in your specific case, we could at least check for some number of numbers and if they are not there to display an error.