Click to See Complete Forum and Search --> : wheres boolean


lcscne
12-12-2003, 11:24 AM
is there a boolean datatype in js?
cuz the following doesn't seem to work for me.


var blIsDataValid
blIsDataValid = True

if (blIsDataValid) {
document.frmTest.atag.Value = "True"
}
else
{
document.frmTest.atag.Value = "False"
}

pnaj
12-12-2003, 11:36 AM
I think (true/false) should be lowercase:

Try:

var blIsDataValid = true;

if (blIsDataValid) {
document.frmTest.atag.Value = "True";
} else {
document.frmTest.atag.Value = "False";
}

lcscne
12-12-2003, 11:52 AM
yup that'll do it, i also needed to change .Value to lower case too. This web development is crazy all the different languages one needs to know.

pnaj
12-12-2003, 12:01 PM
Yeah, sure is.

pnaj.

fredmv
12-12-2003, 12:56 PM
Originally posted by lcscne
yup that'll do it It wouldn't actually — remember that JavaScript is case-sensitive, therefore:document.frmTest.atag.Value
Would not work. You could also shorten it by using the conditional/ternary operator:document.frmTest.atag.value = (blIsDataValid) ? 'true' : 'false';