I create 2 radio buttons. When the user clicks on the 1st button, the test_interface function should be called. When the user clicks on the 2nd button, the test_interface function should not be call. I have a problem with my code,please help me. Thank you very much. if I click on the 2nd button first, then click on the 1st button. It works correctly. Once, the 1st button is selected, then I change to select the 2nd button. Some how the test_interface function is still being called for the 2nd button. How do I fix it to make the test_interface function is clear when the 2nd button is clicked?
<input type=”radio” name=”group1″ id=”button1″ onclick=”javascript:onRadioClick();”/>Button 1
<input type=”radio” name=”group1″ id=”button2″ onclick=”javascript:onRadioClick();” checked/>Button 2
function onRadioClick()
{
if(document.getElementById(“button1”).checked)
{
test_interface();
}
else
{
return null;
}
}
function test_interface ()
{
}