I had an I Agree Checkbox that when checked or unchecked it used JS to toggle the Disabled setting on a button with id="submit1". However, I added more buttons and now it needs to toggle all of these buttons rather than just the first, so the ID isn't working anymore.
Current Code for checkbox:
<input type="checkbox" checked id="agree" name="agree" value="ON" onclick="javascript: if(document.getElementById('agree').checked==true){document.getElementByID('submit1').disabled=false;}else{document.getElementByID('submit1').disabled=true;}">
And for button:
<button onclick="do_file_form_submit(7);" id="submit1" name="submit1" class="custombutton">Button Number 1</button>
So, I have added more buttons, so I need 2 things:
I need
JSorjquerythat will loop through and toggle EACH button when the box is checked rather that just the single button (first button with the ID).- On page load, I also need it to check and see if the box is
checkedand if not, loop through anddisableall of those buttons.
- On page load, I also need it to check and see if the box is
Thanks so much for any help you can give!!
Craig