I have an ajax method that creates a new form. I want one of the
input boxes to be focused when the form gets displayed. So in my
inline RJS I have
page << “document.getElementById(‘post_title’).focus();”
The input box is being created with
<%= text_field ‘post’, ‘title’ %>, so the ID should end up being
‘post_title’ - FireFox’s DOM inspector confirms it.
However the text field isn’t getting focused, so I must be doing
something wrong. Any advice?