N
Neo Geshel
Greetings,
I have a form with a telephone field. It is very specific, as it has
four text boxes - the country code, area code, prefix and suffix. I can
validate each of them individually, but I am stumped as to how to
validate them as a group (as one final validation). I need to check to
see if all (at one time) are filled or empty. The other individual
validations handle cases where the text boxes are filled with letters or
incompletely filled (I simply use a regular expression that checks for
an exact number of integers). However, I need to check if the entire
phone field has been filled or left empty.
One way I did it with PHP was to string all the fields together, then
run an if-else that first checked if the entire string was 12 integers
long, or if it was less than or equal to 2 integers long (the default
country code of 01). If it was the former, then the phone number was OK.
If it was the latter, there was no phone number inputted, and it could
be ignored. And if it was somewhere in-between or failed the regex, the
validation failed and the error message would be displayed.
Is there any method that anyone might suggest to do it as I did it in
PHP? I am hoping to have it done alongside the normal form validation,
so that the
if (Page.IsValid){}
can run as normal and be affected as appropriate from a badly formed
phone number.
TIA
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************
I have a form with a telephone field. It is very specific, as it has
four text boxes - the country code, area code, prefix and suffix. I can
validate each of them individually, but I am stumped as to how to
validate them as a group (as one final validation). I need to check to
see if all (at one time) are filled or empty. The other individual
validations handle cases where the text boxes are filled with letters or
incompletely filled (I simply use a regular expression that checks for
an exact number of integers). However, I need to check if the entire
phone field has been filled or left empty.
One way I did it with PHP was to string all the fields together, then
run an if-else that first checked if the entire string was 12 integers
long, or if it was less than or equal to 2 integers long (the default
country code of 01). If it was the former, then the phone number was OK.
If it was the latter, there was no phone number inputted, and it could
be ignored. And if it was somewhere in-between or failed the regex, the
validation failed and the error message would be displayed.
Is there any method that anyone might suggest to do it as I did it in
PHP? I am hoping to have it done alongside the normal form validation,
so that the
if (Page.IsValid){}
can run as normal and be affected as appropriate from a badly formed
phone number.
TIA
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************