How to check...">

How to determine if DOJO is checked or not?

<input id="test" type="checkbox" value="test" data-dojo-type="dijit.form.CheckBox">

How to check the dojo checkbox the checkbox is checked or not in my javaScript function.

+5
source share
2 answers

You can use javascript function checked on id, for example:

 if (test.checked == 1){
          alert("checked") ;
    }
else{
          alert("unchecked") ;
    }

Here .checked will return "1" if checked.
Please try this in your javascript and let me know in case of any problems.

+6
source

You can check this in various ways. You can use simple HTML / DOM / JavaScript and use something like:

if (document.getElementById("test").checked) { ... }

or using Dojo:

if (dojo.byId("test").checked) { ... }

Here is what @Shreyos Adikari said, I think, but you can also use the widget itself (which does the same behind the screens):

if (dijit.byId("test").checked) { ... }

, DOM, / Dojo CheckBox/, . , , .

, , ( Dojo), API , , .

+13

All Articles