IE9 tabbable div inside form not submit?

When creating a divbable div inside a form, most browsers do not submit the form when the div is focused and input is pressed.

See this example: http://jsfiddle.net/SBfKs/3/

IE9 for some reason. Does anyone know how to override this in IE9 to make it consistent between browsers?

Any help would be greatly appreciated.

+3
source share
1 answer

Interestingly, I did not know that IE would submit the form in this case.

(IE keydown) , <div>. <div> - , , ( jQuery):

$(document).ready(function() {
    var $form = $('#foo');
    $form.on('keydown', 'div', function(e) {
        code = (e.keyCode ? e.keyCode : e.which);
        if (code === 13) {
            e.preventDefault();
        }
    });
});

+2

All Articles