is this javascript function (checkValidity) correct?
function checkTextBox(textBox)
{
if (!checkValidity(textBox.getValue()))
displayError("Error title", "Error message", textBox);
textBox.focus();
}
function checkValidity(e)
{
var email;
email = "/^[^@]+@[^@]+.[a-z]{2,}$/i";
if (!e.match(email)){
return false;
else
return true;
}
}
EDIT: All the answers appreciated! Thanks!
See Question&Answers more detail:os