Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/11/2014, 14:27
pmfras
 
Fecha de Ingreso: noviembre-2010
Mensajes: 48
Antigüedad: 13 años, 6 meses
Puntos: 1
Respuesta: Enter por tab

No me anda!!!!!, te paso los dos archivos simplicadisimos:


*********************** 4.php

<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
</head>


<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="5.js"></script>

<body>
<form method="post" action="">
<input type='text'>
<input type='text'>
<input type='text'>
</form>
</body>
</html>




************************** 5.js
var inputs = $("form :text"),
length = inputs.length,
i = 0;

$(document).ready(function()
{
console.log(length);
inputs.on("keypress", function(event)
{
var code = event.keyCode || event.which;
if (code == 13)
{
console.log('aaaaaaaaaa');
event.preventDefault();
i = i == length - 1 ? 0 : ++i;
inputs[i].focus();
}
});
})



Discupla si hay algun horror, soy muy nuevo en esto y tal vez hay algun horror.
Saludos y espero atento tu respuesta.