Invalid Checkbox Values
How does one set the value of a checkbox to false or null for unchecked values?
If you use an if statement to check for true/false, you get true when the checkbox is checked (assuming that's the default true value) but you get a blank when it is unchecked. This renders the JavaScript invalid and kills the rest of the script inside that script tag.
If the value is checked, you get a rendered
If the value is not checked, you get
which is invalid.
If you use an if statement to check for true/false, you get true when the checkbox is checked (assuming that's the default true value) but you get a blank when it is unchecked. This renders the JavaScript invalid and kills the rest of the script inside that script tag.
If the value is checked, you get a rendered
if (true) { do this ... }
If the value is not checked, you get
if() { do this ... }
which is invalid.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Hey Harry,
You should be able to work around this by:
var checkboxVal = "${config.checkboxfield}";
if (checkboxVal) { do this ...}
1 person says
this answers the question
-
Inappropriate?Okay, thanks, that'll do. But please mark this as +1 for returning a boolean in a future update since "" == false returns true but "" === false returns false.
I’m happy
Loading Profile...



