can anybody see the issue with the following code? My script continues, ignoring my check.
The code below is only a snippet of the code but this issue is in here somewhere after doing some debugging.
function validatePasswordMatch(string1, string2) {
if (string1 != string2) {
return false;
} else {
return true;
}
}
var validatePasswordMatchFields = ["textbox2", "textbox3"];
if (validatePasswordMatch($("#" + validatePasswordMatchFields[0]).val(), $("#" + validatePasswordMatchFields[1]).val())) {
(some code)
} else {
return false;
}
return string1 == string2;!some coderuns then it means that the two values are equal. What else did you expect? Do you run it at the wrong time? What values do the two textboxes have?if (boolean) { return false; } else { return true; }. Why do you even need this function? Just doif (expr1 == expr2) { some code } else { return false; }