Html form: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<< [[Accessibility]] | << [[Accessibility]] | ||
== Tab index == | |||
If the <span class="code">submit/reset</span> buttons were replace with the <span class="code">div/a</span> blocks. | If the <span class="code">submit/reset</span> buttons were replace with the <span class="code">div/a</span> blocks. | ||
| Line 31: | Line 32: | ||
* [http://htmldog.com/guides/html/advanced/forms/ Accessible Forms | HTML Dog] | * [http://htmldog.com/guides/html/advanced/forms/ Accessible Forms | HTML Dog] | ||
== Accesskey == | |||
[http://www.w3schools.com/tags/att_global_accesskey.asp HTML Global accesskey Attribute]. Avoid to conflict with the browser keyboard shortcut e.g. [https://support.google.com/chrome/answer/157179?hl=en Chrome keyboard shortcuts]. | |||
* Press {{kbd | key=Alt}} +{{kbd | key= D}} will switch to Url address on {{Chrome}}. | |||
[[Category:WebDesign]] | [[Category:WebDesign]] | ||
Revision as of 15:40, 7 November 2016
Tab index
If the submit/reset buttons were replace with the div/a 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.
used functions:
- jQuery Howto: jQuery Form Reset
- .submit() | jQuery API Documentation
- .keypress() | jQuery API Documentation
keypress event works on div element but not a element.
further reading:
Accesskey
HTML Global accesskey Attribute. Avoid to conflict with the browser keyboard shortcut e.g. Chrome keyboard shortcuts.