Try this:
<script>
function toggle(bool) {
document.getElementById("targetRadio1").disabled = bool;
document.getElementById("targetRadio2").disabled = bool;
}
</script>
<input type="radio" name="r1" on click="toggle(true)" value="1" />
<input type="radio" name="r1" on click="toggle(false)" value="2" />
<br />
<input type="radio" name="r2" value="3" id="targetRadio1" disabled />
<input type="radio" name="r2" value="4" id="targetRadio2" disabled />
All you have to do now is remove the internal space in the event handlers "on click". JavaRanch just won't let me include a post including this
word... Aparently there's some evil conspiracy theory involving JavaScript or something like that...
If you want dinamically generated radio buttons, all you have to add is a loop statement to build the "id" attribute, like "targetRadio" + x