Marine1969
IS-IT--Management
Hello,
I am running a comparison between a variable passed to a function and the value from an input box. I have tried setting all variables to strings using variable.toString() and it never comes up true. Why do they never return true when they show the same string? If I put the string into the comparison it comes up true (but not when the string is passed to the function:
I am running a comparison between a variable passed to a function and the value from an input box. I have tried setting all variables to strings using variable.toString() and it never comes up true. Why do they never return true when they show the same string? If I put the string into the comparison it comes up true (but not when the string is passed to the function:
JavaScript:
if (bar=='039842000189')
JavaScript:
function barc_a(id, bcb, bcc) {
myid='a'+id;
var bar = document.forms[myid].bc.value;
bar=bar.toString();
bcb=bcb.toString();
bcc=bcc.toString();
if (bar==bcb) {var xbcb = true;} else {var xbcb = false;}
if (bar==bcc) {var xbcc = true;} else {var xbcc = false;}
alert(xbcb);
}