how i can validate the password and name field in php...
Name- take only alphabets.
password- show in * form
plese reply me..
thanks...
Password show in * form..
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Pranay RanaRank #735 · 3.2K reputationPosted Feb 8, 2015, 9:02 PM EST
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;
}
}
Munesh SharmaRank #174 · 13.9K reputationPosted Feb 8, 2015, 11:59 PM EST
only letters :
/^[a-zA-Z]+$/or/^[a-z]+$/ionly numbers:
/^[0-9]+$/