Toggle specific row of checkboxes


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function toggleDown(nm) {
  2. // written by Daniel P 3/21/07
  3. // toggle checkboxes down a whole column
  4. var lastskuindex = document.getElementById('lastindex');
  5. for ( i=0; i<=lastskuindex.value; i++ ) {
  6. if (document.getElementById(nm+i).checked) { // this one is currently checked
  7. document.getElementById(nm+i).checked = false;
  8. } else {
  9. document.getElementById(nm+i).checked = true;
  10. }
  11. } // looping down the rows
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.