php - No symbol and number in form validation -
i surname.than error checking.
if (preg_match("/[\d]/",$surname)) { $surnameerr = true; }
the error shown when number input. symbols not validated. ask how validate symbols?
moveover, how validate types of country character name checking no digit , symbols. thanks.
try following code .
$pattern = '/[^a-za-z]/'; $surnameerr = preg_match($pattern,$surname); if($surnameerr==""){ $surnameerr =true; }else{ $surnameerr =falsee; }
Comments
Post a Comment