SeanNij
asked on
Email Validation Using JavaScript in ASP
Hi all,
Very very new to ASP and Java. With the help of much reading on EE I have managed to get some validation working for my ASP development. However, in trying to get my Email validation to working using JavaScript and RegEx, it falls apart.
The validiation works for the blank LMFullName but not for the Email Address.
I'm sure its got to do with my JavaScript - help....
Very very new to ASP and Java. With the help of much reading on EE I have managed to get some validation working for my ASP development. However, in trying to get my Email validation to working using JavaScript and RegEx, it falls apart.
The validiation works for the blank LMFullName but not for the Email Address.
I'm sure its got to do with my JavaScript - help....
<script language="JavaScript" type="text/javascript">
<!-- JavaScript to validate form and disable submit button
function isEmail(strValue){
var objRegExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return objRegExp.test(strValue);
}
function CheckForm(form)
{
document.getElementById("LMFullName").innerHTML = "";
if (form.txt_LMFullName.value == "")
{
document.getElementById("LMFullName").innerHTML = "<font color=#FF0000>*";
form.txt_LMFullName.focus();
return false;
}
if(!isEmail(form.txt_LMEmailAddress.value))
{
err += "- e-mail Addresse\n";
if(form.txt_LMEmailAddress.value == "") focusField = "email";
}
if(err != ""){
document.getElementById("EmailAddress").innerHTML = "<font color=#FF0000>*";
form.txt_LMEmailAddress.focus();
return false;
}
document.form1.button_Save.disabled=true;
document.form1.button_Save.value="Done.";
return true ;
}
//-->
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are very welcome. Thanks for the assist, and the points.
Good luck & have a great day.
Good luck & have a great day.
ASKER