I have two radio buttons in my form. Now what I found out is that in firefox, if you refresh the form, is a radio button was selected before the refresh, then after the refresh the radio button is still selected. I want to know is there a way by using javascript code to be able to say no radio buttons should be already selected when page reloads or refreshes or does it all depend on browser?
I tried including in the window.onload=function()which I thought would do the trick but it didn't work. Any ideas?Code:btnRadioO[0].checked==false && btnRadioO[1].checked==false
Below is code for radio buttons in javascript:
Html code:Code:window.onload=function(){ var btnRadioO = document.getElementsByName("weightChoice"); btnRadioO[0].checked==false && btnRadioO[1].checked==false; }
Code:<table> <tr> <th>6: Provide a Total Weight for your Yourself</th> <td><input type="radio" name="weightChoice" value="yes" onClick="getWeight()"/> Yes</td> <td><input type="radio" name="weightChoice" value="No" onClick="getWeight()"/> No</td> </tr> </table>



Reply With Quote





Bookmarks