How to submit a form WITHOUT clicking a submit button?
I want the form to be submitted when 开发者_StackOverflowthe user chooses one of the radio button options. I know how to do this with select fields:
<select name='something' onchange="this.form.submit()">
But how to do this with radio buttons?
You can use onclick:
<input type="radio" name="something" onclick="this.form.submit()">
You can test for compatibility (of keyboard entry like left/right or tabbing then pressing space/enter and even keyboard only navigation plugins) using this example.
Try hooking into the onclick
event.
<input type="radio" name="something" value="somethingvalue" onclick="this.form.submit();" />
精彩评论