netfrugal Posted November 29, 2006 Share Posted November 29, 2006 I would like to submit a form with only 2 radio buttons: On / OffIs there a way to submit the form when I click one of the radio buttons, and not a submit button? Link to comment https://forums.phpfreaks.com/topic/28914-submit-a-form-with-no-button/ Share on other sites More sharing options...
DeathStar Posted November 30, 2006 Share Posted November 30, 2006 Yes :oJust remove <input: submit blahblah>then ull have to pres enter to submit!or just creat [move]links![/move] Link to comment https://forums.phpfreaks.com/topic/28914-submit-a-form-with-no-button/#findComment-132476 Share on other sites More sharing options...
cmccully Posted November 30, 2006 Share Posted November 30, 2006 Try using javacript. use the on_click or on change property. You can have this function call your php function or the same page.Hope this helps.cmccully Link to comment https://forums.phpfreaks.com/topic/28914-submit-a-form-with-no-button/#findComment-132479 Share on other sites More sharing options...
Daniel0 Posted November 30, 2006 Share Posted November 30, 2006 Put this in both of your radio buttons:[code]onclick="this.form.submit();"[/code]Example: [code]<form action="other_page"><label><input type="radio" name="test" value="yes" onclick="this.form.submit();" /> Yes</label> - <label><input type="radio" name="test" value="no" onclick="this.form.submit();" /> No</label></form>[/code] Link to comment https://forums.phpfreaks.com/topic/28914-submit-a-form-with-no-button/#findComment-132682 Share on other sites More sharing options...
ToonMariner Posted December 1, 2006 Share Posted December 1, 2006 This requires js - IMO you should ALWAYS have a submit button with a from just to ensure everyone can use it. Link to comment https://forums.phpfreaks.com/topic/28914-submit-a-form-with-no-button/#findComment-133108 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.