1
I would like to get a user proper Real Name and Contact number (i have change AIM field to contact number), but i found some user had key in number in Real Name field and a word in Contact Number field, this is what i dont want.
I had add in the code below to make sure user fill in the Real Name and Contact number.
$name = '';
if (!empty($_POST['name'])) {
$name = $myts->stripSlashesGPC(trim($_POST['name']));
}
if ($name == '') {
$errors[] = _US_NEEDNAME;
}
$user_aim = '';
if (!empty($_POST['user_aim'])) {
$user_aim = $myts->stripSlashesGPC(trim($_POST['user_aim']));
}
if ($user_aim == '') {
$errors[] = _US_NEEDCONTACT;
}
but this is not enought the number still could save as Real Name and the wording still could save as Contact number.
Is there any ideal for use to insert the alert code something like below?
if ($name == '0-9'){
alert("Please fill out the proper name")
element.focus()
}
if ($user_aim == 'a-z'){
alert("Please fill out the proper contact number")
element.focus()
}