Simple email validation problem

[AS]on (release) {

if (!form.length || form.indexOf("@") == -1 || form.indexOf(".") == -1) { 
message = "Please enter a valid E-mail address"; 

} else { 

loadVariablesNum("mail.php", "0", "POST"); 
message = "Sending..."; 
}

}
[/AS]

even when its a valid email address it still gives the invalid email message. any ideas?

on (release) {
	if (form.length && form.indexOf("@") != -1 && form.indexOf(".") != -1) {
		loadVariablesNum("mail.php", "0", "POST");
		message = "Sending...";
	} else {
		message = "Please enter a valid E-mail address";
	}
}

worked…thanks

welcome

And who said we’ve lost the art of conversation :beam:

in cases such as this, use trace() to find out what happens:
trace(form.indexOf("@"));
see what you get with both valid/invalid email…
DEBUG!