Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function disable_Options(c) {
- // Get the list of radio options with class name form-radio
- var radio = document.getElementsByClassName("form-radio");
- // Check each class name radio button
- for(var i = 0; i < radio.length; i++) {
- //Set what specific conditions if an option is selected and list the ones that will be disabled.
- // radio[0] is selected then disable radio[1]
- if(radio[0].checked) {
- radio[1].disabled = true;
- radio[1].parentNode.style.opacity = "0.7";
- }
- // if radio [2] is selected then disable radio[3]
- else if(radio[2].checked) {
- radio[3].disabled = true;
- radio[3].parentNode.style.opacity = "0.7";
- }
- radio[i].disabled = false;
- radio[i].parentNode.style.opacity = "1";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement