how i can validate the password and name field in php...
Name- take only alphabets.
password- show in * form
plese reply me..
thanks...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Feb 9, 2015, 4:59 AM
only letters :
/^[a-zA-Z]+$/or/^[a-z]+$/ionly numbers:
/^[0-9]+$/
Pranay RanaPosted Feb 9, 2015, 2:02 AM
Example code :
function validateForm(){
var nameRegex = /^[a-zA-Z]+$/; var validfirstUsername =
document.frm.userName.value.match(nameRegex);
if(validUsername == null)
{
alert("Your username name is not valid. Only characters A-Z, a-z are acceptable.");
document.frm.userName.focus();
return false;
}
}