<script type="text/javascript">
function validate_email(field, alerttxt) {
with(field) {
apos = value.indexOf("@");
dotpos = value.lastIndexOf(".");
if (apos < 1 || dotpos - apos < 2) {
alert(alerttxt);
return false;
} else {
return true;
}
}
}
function validate_form(thisform) {
with(thisform) {
if (validate_email(username, "Your UserName is Not Valid!") == false) {
username.focus();
return false;
}
}
}
</script>In this code how to validate the email. using java script.
