Is there a way to globally check all boxes in a list

Options
Hello!



I'm sure I'm not using the correct terminology but we have a Luminate donation form we are using for an event and one element on the page is a list of table captains.  Every time I make a change to the list of table captains, I need to re check all the boxes in the list for the table captains to make everything appear correctly on the donation form.



Is there a function within Luminate where you can check all so I do not need to individually check each box every time?



thanks for any help!



joanne
Tagged:

Comments

  • From your browser's development console:

    var chkboxes = document.querySelectorAll(&#39;input[type="checkbox"]&#39;);<br /><br/>for (var i = 0; i < chkboxes.length; i++) {<br /><br/>&nbsp;&nbsp;&nbsp;&nbsp;chkboxes[i].checked = true;<br /><br/>}<br /><br/>&nbsp;

    This will select and check ALL <input type="checkbox"> on a page. If you need to select only checkboxes in a specific element, you'll need to select that element first:

    var chkboxParent = document.querySelector(&#39;#checkboxListExample&#39;);<br /><br/>var chkboxes = chkboxParent.querySelectorAll(&#39;input[type="checkbox"]&#39;);<br /><br/>&nbsp;

    And if you need your code to be XML-compliant, you'll need to change the ".checked" value on the chkboxes array:

    &nbsp;&nbsp;&nbsp;&nbsp;chkboxes[i].checked = &#39;checked&#39;;<br /><br/>&nbsp;
  • Mark Kindy:

    From your browser's development console:

    var chkboxes = document.querySelectorAll(&#39;input[type="checkbox"]&#39;);<br /><br/>for (var i = 0; i < chkboxes.length; i++) {<br /><br/>&nbsp;&nbsp;&nbsp;&nbsp;chkboxes[i].checked = true;<br /><br/>}<br /><br/>&nbsp;

    This will select and check ALL <input type="checkbox"> on a page. If you need to select only checkboxes in a specific element, you'll need to select that element first:

    var chkboxParent = document.querySelector(&#39;#checkboxListExample&#39;);<br /><br/>var chkboxes = chkboxParent.querySelectorAll(&#39;input[type="checkbox"]&#39;);<br /><br/>&nbsp;

    And if you need your code to be XML-compliant, you'll need to change the ".checked" value on the chkboxes array:

    &nbsp;&nbsp;&nbsp;&nbsp;chkboxes[i].checked = &#39;checked&#39;;<br /><br/>&nbsp;

    Thanks Mark!  Appreciate the response but this is all Greek to me, but I'll talk to my web designer about it.  Happy New Year!

     

  • Google Chrome has a plug in called Check All by Tejji. You can click it to automatically check or uncheck everything on the page. I use it often.

Categories