I made a simple form with jquery and javascript, but the email verification (makes sure it has @ or . in it, does not seem to work.
Here is the JSFiddle: http://jsfiddle.net/LCBradley3k/xqcJS/11/
Here is the code for the validation. Is it in the wrong spot?
function validateForm() {
var x = document.forms["signup"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if(atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
$('#answer').html('Not a valid email')
return false;
}
}