Eiolon Posted July 5, 2011 Share Posted July 5, 2011 I am using a script that simulates an onclick if a checkbox was selected when my record loads, but have not been able to modify it for a radio button and if a certain value is selected. Here is what I am using: <script type="text/javascript"> window.onload = function() { if (document.forms[0].checkboxname.checked == true) { document.forms[0].checkboxname.onclick(); } } </script> Any ideas? thnaks! Quote Link to comment https://forums.phpfreaks.com/topic/241139-simulate-onclick-if-certain-radio-button-is-selected/ Share on other sites More sharing options...
AyKay47 Posted July 5, 2011 Share Posted July 5, 2011 why can't you simply invoke an onclick event from the input tag? <input type="radio" name="group1" value="Milk" onclick="someFunc()"> Milk<br> Quote Link to comment https://forums.phpfreaks.com/topic/241139-simulate-onclick-if-certain-radio-button-is-selected/#findComment-1238621 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.