input field bypassing by <enter> w/o form submission
Dear jQuery's guru,
I faced a problem!
I want to bypass from one input field to other one by <enter> (<return>) key pressing instead of default behaviour (<tab> key pressing).
But there was default form action on <enter> keydown event was performed. Remember that <enter> keydown event on form means default "Form submit" action.
How to prevent default action, form submission, in time of <enter> keydown event processing?
How to modify following code? I use hotkeys jQuery plugin for key binding to input fields.
$().ready(function(){
$(myInputFieldsSelector).bind('keydown','return',function(evt){
//find next input field in the form MyNextInput
MyNextInput.focus().select();
//stop event propagation and prevent default action
return false;//didn't work - form submission was happened
});
}
Thank you for advice!