Hi,
Can anyone make me understand in JavaScript what is all which are in bold, I need simple function to validate a text-field on a form that is to hold an email address. The below in bold is complex for me to understand. Please make correction or provide new function.
Can anyone make me understand in JavaScript what is all which are in bold, I need simple function to validate a text-field on a form that is to hold an email address. The below in bold is complex for me to understand. Please make correction or provide new function.
Code:
<script type="text/javascript">
function validateEmail(Form)
{
[B]if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Form.emailAddr.value))[/B]
{
alert("Valid Email Address");
return (true)
}
alert("Invalid E-mail Address!")
return (false)
}
//-->
</script>
Comment