How do I compare strings in javascript? The "==" double equals or
"!=" doesn't seem to work in this case.
I'm sure string comparison has been explained before but searching
Google didn't find any code that looked similar to this one:
-----
function CheckPassword(v al,val2, str) {
var strInput = new String(val.valu e);
var strInput2 = new String(val2.val ue);
if (strInput!=strI nput2) {
alert(str);
val2.focus();
val2.select();
return false;
} else
return true;
}
-----
Thanks for your help.
"!=" doesn't seem to work in this case.
I'm sure string comparison has been explained before but searching
Google didn't find any code that looked similar to this one:
-----
function CheckPassword(v al,val2, str) {
var strInput = new String(val.valu e);
var strInput2 = new String(val2.val ue);
if (strInput!=strI nput2) {
alert(str);
val2.focus();
val2.select();
return false;
} else
return true;
}
-----
Thanks for your help.
Comment