Html form: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<< Accessibility If the {{kbd | key=submit/reset}} buttons were replace with the {{kbd | key=a/div}} blocks. Before: <pre> <input type='text' name='text1'> <br /> <input...") |
(No difference)
|
Revision as of 16:03, 13 October 2014
If the submit/reset buttons were replace with the a/div blocks.
Before:
<input type='text' name='text1'> <br /> <input type='reset' value='Reset' name='reset'> <input type="submit" value="Submit">
After:
<input type='text' name='text1' tabindex="1"> <br /> <div id="clear_my_form" tabindex="2"><a href="#">reset</a></div> <div id="submit_my_form" tabindex="3"><a href="#">submit</a></div>
takes the Accessibility issues into consideration:
- tabindex: Users are able to press tab key to jump to next form element.
- press space key or enter key to trigger the reset or submit the form.
- press enter key to submit the form in any input box.
further reading:
- HTML Global tabindex Attribute
- jQuery Howto: jQuery Form Reset
- .submit() | jQuery API Documentation
- .keypress() | jQuery API Documentation
keypress event works on div element but not a element.