How to position cursor on first input field?

It must be simple, but I haven’t been able to figure it out.

It must be simple, but I haven’t been able to figure it out.

If it’s the first form this would work:

<%= javascript_tag “$$(‘form input[type=text]’).first().focus()” %>

Tweak as necessary to target the form/element in question…

-philip

Philip H. wrote:

It must be simple, but I haven’t been able to figure it out.

If it’s the first form this would work:

<%= javascript_tag “$$(‘form input[type=text]’).first().focus()” %>

Also don’t forget to include the Prototype scripts in the section
to use the $$ method:

<%= javascript_include_tag :defaults %>