I am trying to change the enter key to tab in asp.net mvc.
Whenever I pressed 'Enter', the page refreshed so I used the following code and it does work mostly although I couldn't change the keycode to 9:
$(document).on("keypress", 'form', function (e) {
var code = e.keyCode || e.which;
if (code == 13) {
e.preventDefault();
window.event.keyCode = 9;
return false;
}
});
The following line of code does not work:
window.event.keyCode = 9;