p.kennedy Posted December 29, 2011 Share Posted December 29, 2011 Is there a way to prevent someone from entering anything but numbers in a phone field? Link to comment Share on other sites More sharing options...
FreightTrain Posted December 29, 2011 Share Posted December 29, 2011 p.kennedy Where would someone be entering in this value? Link to comment Share on other sites More sharing options...
p.kennedy Posted December 29, 2011 Author Share Posted December 29, 2011 Not Sure yet, just looking for some code or something that will keep a phone number formatted a certain way. Link to comment Share on other sites More sharing options...
FreightTrain Posted December 29, 2011 Share Posted December 29, 2011 p.kennedy These are two separate issues: 1) Is there a way to prevent someone from entering anything but numbers in a phone field? and 2) ...looking for some code or something that will keep a phone number formatted a certain way. 1) No. 2) See the XML rule "Change phone format rule" Link to comment Share on other sites More sharing options...
step Posted December 30, 2011 Share Posted December 30, 2011 You could use this regular expression that doesn't return anything except digits: var str = "12three456 seven eight9"; return str.replace(/\D/g,''); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.