M
MC
Question,
Why does the following code register the event for input type button but not
radio? (And how do I make this happen?)
Thanks,
MC
<HTML>
<FORM name='x' action=''>
<input type='radio' name='rbTest' id='YES_1' value='1'>YES
<input type='radio' name='rbTest' id='NO_1' value='0'>NO
<input type='button' name='btnTest' id='btnTestid' value='test'>
</FORM>
<SCRIPT LANGUAGE="Javascript" type="text/javascript">
document.x.btnTest.onclick = doTest;
document.x.rbTest.onclick = doTest;
function doTest(e) {
alert('doTest');
}
</SCRIPT>
</HTML>
Why does the following code register the event for input type button but not
radio? (And how do I make this happen?)
Thanks,
MC
<HTML>
<FORM name='x' action=''>
<input type='radio' name='rbTest' id='YES_1' value='1'>YES
<input type='radio' name='rbTest' id='NO_1' value='0'>NO
<input type='button' name='btnTest' id='btnTestid' value='test'>
</FORM>
<SCRIPT LANGUAGE="Javascript" type="text/javascript">
document.x.btnTest.onclick = doTest;
document.x.rbTest.onclick = doTest;
function doTest(e) {
alert('doTest');
}
</SCRIPT>
</HTML>