3.2.0

checkbox problem

in the following code fragment, although the status window always displays the correct value, the if..else statement will always evaluates to false. If I switch 'if value="false")' to ' if value = "true")' the statement will alway evaluates to true. What am I doing wrong?

var national = new AW.UI.Checkbox; //national
national.setControlText("National");
national.setId("national");
national.setControlValuefalse);
national.onControlValueChanged = function(value){
window.status = "control value: " + value;
if (value = "false") {cnational.setControlText("N");}
else{cnational.setControlText("Y");}
}
February 11,
figured it out. should be if (value).....else.
February 11,
actually, when you check if value equals true or false, you need to use == instead of =. = sets value to whatever you put to the right of the = sign.

so change:

if (value = "false")

to:

if (value == "false")
Joel
February 12,

This topic is archived.

See also:


Back to support forum