It functioned perfect, but it would have as to function without using labels? 

my formu:

<form action="#" method="get" onsubmit="return false;">
        Campo 1: <input type="text" name="campo1" tabindex="0" /><br />
        Campo 2: <input type="text" name="campo2" tabindex="1" /><br />
        Campo 3: <input type="text" name="campo3" tabindex="2" /><br />
        Campo 4: <input type="text" name="campo4" tabindex="3" /><br />
        Campo 5: <input type="text" name="campo5" tabindex="4" />
        <input type="submit" name="sub" id="sub" value="Enviar" />
</form>


Roberto Ortelli wrote:
> 
> 
> Fabyo,
> pay attention, the solution below only works if you have a form like that:
> <form>
> One <input type="text name="one" value="" />
> Two <input type="text name="two" value="" />
> Three <input type="text name="three" value="" />
> </form>
> 
>> $("[EMAIL PROTECTED]").bind("keydown", function(e){
>>                if (e.keyCode == 13) {
>>                        $(this).next().focus();
>>                        return false;
>>                }
>>        });
>>
> 
> If you have a more complex/realistic form like:
> <form>
> <label>One <input type="text name="one" value="" /></label>
> <label>Two <input type="text name="two" value="" /></label>
> <label>Three <input type="text name="three" value="" /></label>
> </form>
> 
> ... you can use something like:
> 
> $("[EMAIL PROTECTED]").bind("keydown", function(e){
>               if (e.keyCode == 13) {
>                       $(this).parent().next().children("input").focus();
>                       return false;
>               }
>       });
> 
> 

-- 
View this message in context: 
http://www.nabble.com/to-change-tab-for-enter-tf3584151s15494.html#a10021000
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to