Been making a simple form + data validation thing, I'm using indexof to make sure there is a "@" and "." in the email address, but it is always returning -1.
var custEmail = document.getElementById("custEmail"); if (custEmail.value == "" || custEmail.value.indexOf("@" == -1) || custEmail.value.indexOf("." == -1)) { alert("You must enter a valid Email address!\n" } I've tried changing the indexof check to different letters instead of the symbols, but it still returns -1, which makes me think I'm trying to get the data incorrectly.