I'd like to either simply swallow an Enter key press in <input>
fields or else instead substitute Tab key presses. I haven't yet decided which is best.
How can I do this in jQuery? I've got this so far:
$(document).ready(function(){
...
//handle enter key
$("input").keypress(function (e) {
var k = e.keyCode || e.which;
if (k == 13) {
//???
}
});
});
(That e.keyCode || e.which
part was recommended in this question.)
What might I put there to either (a) cancel the event or else to (b) force a Tab key press?