When creating a tabbable div inside a form, most browsers don’t submit the form when the div is focused and enter is pressed.
See this example: http://jsfiddle.net/SBfKs/3/
IE9 does though for some reason. Does anyone know how to override this in IE9 to make it consistent across browsers?
Any help would be greatly appreciated.
Interesting, I didn’t know IE would submit the form in this case.
You could trap keypresses (IE submits on
keydown) and cancel the default behavior if on a<div>. If<div>is the only element you’re going to add the ability to focus on, this should fix the issue (jQuery solution):Fiddle here