How do I focus cursor on a specific text_field_tag when loading a partial with AJAX?
Posted on 2010-08-12
I have found solutions for focusing on the text_field when the entire page is loaded, however I have a partial that includes a text_field_tag with an associated observe_field. My problem is that when the partial is reloaded every half second, the focus does not go back to the text_field_tag, which is annoying since the user may not be done typing their filter text. I have tried putting the text_field_tag outside of the partial, and that keeps the focus there, but screws up other things (I have the ability to reorder based on columns in a table, and it doesn't seem to remember the order preferences the use chose).