:: Forum >>

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.onControlValueChanged = function(value){
window.status = "control value: " + value;
if (value = "false") {cnational.setControlText("N");}
Sunday, February 11, 2007
figured it out. should be if (value).....else.
Sunday, February 11, 2007
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")


if (value == "false")
Monday, February 12, 2007

This topic is archived.

Back to support forum

Forum search