Hello, I have a dojo 'form' element with three checkboxes (same class but unique ids). Once user makes a selection, I would like to get the id(s) and number of boxes checked. I am looking into dojo.query but having a hard time getting the results (though I could get the number of boxes that are checked). Can you please direct me to some examples where I can get clarity on this issue? Thanks Samir
Do they each have an id? If so you could use dijit.byId to get the check box. Here's an example where we get value for a checkbox:
var bx1 = dijit.byId('checkBoxquakes');
console.log(bx1.id + " " + bx1.checked);
As you pointed out you could also use dojo.query. In this snippet we get all the checkboxes in the app then loop through and write out the id and whether or not the box is checked to the console:
Thanks Kelly for your response, I'll definitely try out these examples. I am not sure how does console.log function? How do I retrieve the id's from the console? Thanks Samir
Console.log writes information out to the console window. In your situation you may want to assign the id to a variable that you can then use later in your code.