frozenpeas
Technical User
Hi,
The following code currently accepts whatever the value of the variable is, as long as it contains a letter. It will reject "9" but will accept "a9". I need to allow only letters - am I using this properly?
Thanks.
frozenpeas
The following code currently accepts whatever the value of the variable is, as long as it contains a letter. It will reject "9" but will accept "a9". I need to allow only letters - am I using this properly?
Thanks.
Code:
$patternAlpha = "[a-z]";
if(!eregi($patternAlpha,$namef)){
$errorFlag = 1;
$errorMsg .= "The First Name field may contain only letters.<br>";
}
frozenpeas