Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which function again? 1

Status
Not open for further replies.

smashing

Programmer
Oct 15, 2002
170
US
I'm asking people to enter their phone numbers in a form field.
I've figured out how to strip any slashes or other stuff that I don't like that they might have put in there, but I wanna force them to enter their area code.
So...
1)I'm looking for a function that counts the number of characters. and send them an error if they didn't enter my specified amount

2)Next I want to strip the 1 in there but only if it is the first character i.e. remove the 1 from 1-347
but not the 1 from 314
Any ideas?? Thanks
 
Try not to create one of those sites where they think that only the American or English way of doing things exists. I'm talking about the sort of site that says something like

Please enter your Zip or Postal Code

but if you try to actually put in an English post code it says that it is an invalid zip code. Of course it is, that's because it isn't one. And then if you try to leave it blank it says you can't continue because it is a required field.

I have seen so many sites that have done that that I can't even be bothered to tell them about it anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top