Multiple Submit Buttons vs Enter to submit form
I'm having trouble setting the default submit button AND complying with jquery-mobile styling/markup best practices.
a simple login form, and i want to have the layout:
email: ___
pass: ___
[forgot pass] [login]
so to get that on the buttons and jquery-mobile i must use:
- <fieldset class="ui-grid-a">
- <div class="ui-block-a"><button name="action" value="forgot" type="submit" data-theme="c">I forgot</button></div>
- <div class="ui-block-b"><button name="action" value="login" type="submit" data-theme="b">Log me in</button></div>
- </fieldset>
that makes the [i forgot] button before the [login]... so when the user press ENTER it will send the password reset email... at least on some browsers. on IE i get an empty value.
my initial solution to solve both problems was to add a default value just at the beginning of the form code:
- <!-- handles enter key-press -->
- <input type="hidden" name="action" value="login" /> <!-- handles no JS-->
i even tried adding a new invisible button there to please some internal jquery 'fixing' of the enter keypress to submit forms...
the end result is:
chrome: action=forgot
firefox: action=forgot
android: action=login
what am i doing wrong?