spooke2k Posted July 19, 2007 Share Posted July 19, 2007 is there a way on the onclick on a radio button to call a submit button so the radio button basically does same thing as the submit button thanks Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted July 19, 2007 Share Posted July 19, 2007 im pretty sure you can just add onclick='submit();' in the html Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted July 19, 2007 Share Posted July 19, 2007 onclick=form1.submit() echo "<input type=radio name=BatchStatus checked value='Active' onclick=form1.submit()><font size='2'>Active</font>"; Quote Link to comment Share on other sites More sharing options...
spooke2k Posted July 19, 2007 Author Share Posted July 19, 2007 it works to a sort but not properly why i need to call the button itself thanks Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted July 19, 2007 Share Posted July 19, 2007 can you not do something like form1.submitbutton.click(); or document.getElementById('submit').click(); Quote Link to comment Share on other sites More sharing options...
spooke2k Posted July 19, 2007 Author Share Posted July 19, 2007 sorry didnt seem to work not sure best way to implement can u please show a demo Thanks Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted July 19, 2007 Share Posted July 19, 2007 heres a quick mock-up i did, and it works for me <html> <?php print_r($_POST["submit"]);?> <form name='myform' method='post'> <input type='submit' name='submit' id='submit' value='submit'> <input type='radio' name='radiobut[]' value='1' onclick='myform.submit.click();'>myradio</input> </form> </html> Quote Link to comment 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.