Created
November 13, 2010 23:18
-
-
Save walterdavis/675735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toggleInputs(){ | |
| //replace the placeholder names below | |
| var inputs = $('theNameOfYourSecondaryBox').select('input,select,textarea'); | |
| var checkbox = $('theIdOfYourCheckbox'); | |
| //all the rest of this can stay the same | |
| if(checkbox.checked){ | |
| inputs.invoke('disable'); | |
| }else{ | |
| inputs.invoke('enable'); | |
| } | |
| } | |
| //be sure this matches the name of the box also | |
| $('theIdOfYourCheckbox').observe('click',toggleInputs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment