Greetings, I have the following code I'm using for email validation. It works flawlessly. BUT now I need to add a validation for firstname and lastname that if they are blank they get an error message. I've been jacking around with this for an hour and can't figure it out. Any help would be appreciated. THanks in advance.
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
// End -->
</script>