W
Ward Cleaver
Hi. I have an assignment to do some validating of a form using
javascript and mostly the search() method. I'm having problems
getting a positive validation for phone numbers like "123-456-7890"
and "123.456.7890" but not like "123.456-7890". The regular
expression I'm using now is something like this:
ok = pn.search(/(^\d{3}-\d{3}-\d{4}$)|(^\d{3}.\d{3}.\d{4}$)/);
Which to me looks like it SHOULD do what I want it to and not come
back with an ok=0 for a phone number using both hyphens and periods.
Please help.
javascript and mostly the search() method. I'm having problems
getting a positive validation for phone numbers like "123-456-7890"
and "123.456.7890" but not like "123.456-7890". The regular
expression I'm using now is something like this:
ok = pn.search(/(^\d{3}-\d{3}-\d{4}$)|(^\d{3}.\d{3}.\d{4}$)/);
Which to me looks like it SHOULD do what I want it to and not come
back with an ok=0 for a phone number using both hyphens and periods.
Please help.