Ignore above post, page was submitted b4 i had finnished doing the message LOL
hi,
I have a required telephone form field that i wish to validate as
a) required and b) contains only numbers.
problem I am having is that it is an international form so ppl will use different ways of entering the telephone eg:
USA: 111-111-1111
111-111-1111
UK: 0113 000 0000
0113-111-1111
and so on........
I use the following is numeric check but if there are spaces or dashes in the telephone number then it fails....
if (!$telephone) {
$error = 1;
$errstring .= "<li>+ Please enter your contact telephone number.</li> ";
} elseif ($telephone) {
if (!is_numeric($telephone)){
$error = 1;
$errstring .= "<li>+ The entered Telephone Number contains letters. - Use numbers only<BR></li>";
}
}
are there any functions i can use to check its a number while accounting for spaces and hashes between the numbers
many thanks
webpro