How to disable a radio button if another button higher in the form is selected?
I have tried a bunch of stuff and it just never works once I upload it onto my site and try it. Here is what I have:<script type="text/javascript">function shipSwitch(){if(document.confirm.radio.value == Yes){document.confirm.ground.disabled=true;}else{d ocument.confirm.ground.disabled=false;}}</script>And then in the actual form:<form name="confirm" method="post" action="send.php" id="confirm"><input type="radio" name="ReturnDrive" id="returnDriveYes" value="Yes" onclick="shipSwitch()">//When this is selected, I want the other radio disabled<input type="radio" name="shipping" id="ground" value="Ground">//this is the one that should be disabled.</form>I have tried everything, any suggestions?
|