You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Okke Tijhuis <o....@home.nl> on 2007/11/06 18:48:26 UTC

Best way to autofocus on next formfield?

Hi,

I'm wondering what the best way is to autofocus to the next field in a form.
When the length of a textfield is reached the focus should automatically 
transfer to
the next field in the form. Is there a way to get the next field or do I 
need to set id's
on the fields and keep track of the fields myself? What would be the 
best way to achieve
this?

Thanks in advance,

Okke

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Best way to autofocus on next formfield?

Posted by Johan Compagner <jc...@gmail.com>.
i guess this just involves some javascript attached to the onkey
event, and that function gets as parameters the field itself, the max
length and the next fieldid. Then get the caret position and if that
is the max length request focus on the next

On 11/6/07, Okke Tijhuis <o....@home.nl> wrote:
> Hi,
>
> I'm wondering what the best way is to autofocus to the next field in a form.
> When the length of a textfield is reached the focus should automatically
> transfer to
> the next field in the form. Is there a way to get the next field or do I
> need to set id's
> on the fields and keep track of the fields myself? What would be the
> best way to achieve
> this?
>
> Thanks in advance,
>
> Okke
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org