by cyoung » Tue Dec 08, 2020 11:39 am
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