I have the following code: if (document.contact.email.value == "") { msg = msg+ "- Your Email Address \n"; } Code (markup): I need that field not empty and it must contain @ and . I hope you understand!
if (document.contact.email.value == "" || document.contact.email.value.indexof("@") < 0 || document.contact.email.value.indexof(".") < 0) { msg = msg+ "- Your Email Address \n"; } Code (markup): something like this should work
There are also numerous regex scripts you can find on Google. Try Googling "email validation regex" or something similar if you're looking for something more robust.