A common practice in web applications is that the behavior of the ENTER key is not what it usually has by default, and with jQuery you can change that behavior quite easily.
The required code is this:
function enter2tab (e) {
if (e.keyCode == 13) {
cb = parseInt ($ (this) .attr ('tabindex'));if ($ (': input [tabindex = \ »+ (cb + 1) +' \ ']')! = null) {
$ (': input [tabindex = \ »+ (cb + 1) +' \ ']'). focus ();
$ (': input [tabindex = \ »+ (cb + 1) +' \ ']'). select ();
e.preventDefault ();return false;}}}
You have to include the enter2tab function in the action where you want it to be applied, without any more mysteries.
Source | Crystalb
I tell you, use your code and it does not work for me, I want to control that when pressing ENTER it does the function of a TAB to move the focus to the next input
Check the syntax of the code, as it does not work. It will be because of the fucking single quotes that are transformed into a decoration and there are double quotes that do not close.