a strange thing with form validation..
$('#form1').submit(function() {
var diagnosedValue = $("input[name=diagnose]").val(); // input is radio buttons, hence I have to grab by name, not id
console.log(diagnosedValue ); // prints fine
if (diagnosedValue === "Yes, I'm diagnosed with such-and-such.") {
console.log('yes, diagnosed'); // prints fine
location.href = "survey_diagnosed.html"; // is ignored.. remain on same page..
} else if (diagnosedValue === "I have not been diagnosed with such-and-such.") {
location.href = "survey_not_diagnosed.html"; // is ignored.. remain on same page..
}
});
the two lines that say go to next page (for example survey_diagnosed.html) are ignored...
I don't get this...
I shouldn't have to use a plugin for this right?? I really really hope I don't.. can't understand why the location.href lines are ignored..
thank you...