Javascript problem with name tag (name => 'address[street]')

Hi All

I just noticed that I don’t really know how to deal with the names which
are needed by Rais, for example, with textfield, like
<%= text_field(“address”, “street”, “size” => 10, “name”
=>“address[street]”) %>

I need to set the focus to this textfield, but Javascript doesn’t seem
to be happy at all with the following call:

Any suggestions how to do this ?

Thanks a lot

Any suggestions how to do this ?

Well, if you’ve got the prototype library loaded up you could do:


This works because rails will give that text field an id of

Otherwise you can do:




the javascript example is perfect!. The prototype lib is new for me, it
looks very interesting!!

thnx a lot