I have been having some trouble with my javascript that involves radio buttons. I have no idea how to check if either radio A or radio B have been selected.
My guess:
JS
My guess:
JS
Code:
<script type="text/javascript">
function validate(radios) {
var confirm = document.getElementsByName(radios).value;
var button = document.getElementById("button");
button.disabled = true;
if(confirm == '0')
button.disabled = false;
else
button.disabled = true;
}
</script>
HTML:
<form action="#" method="post" onchange="validate('confirm')">
No <input type="radio" name="confirm" value="0" /><br />
Yes <input type="radio" name="confirm" value="1" /><br />
<input type="submit" value="Go" id="button" />
</form>