Thursday, July 29, 2010

[Rails] Re: I'm trying to get started with AJAX and having a problem..

Found the answer. I was making it much too complicated..

$("search").focus();

did just fine

Bob

On Jul 23, 6:15 pm, Bob Smith <bsm...@gmail.com> wrote:
> I'm trying to set the focus to the first (and only} field on a search
> form and having no luck.
> From searching with google, I came up with:
>
> javascript_tag("Event.observe(window, 'load', function() {
>   var firstForm = $A(document.getElementsByTagName('search'))[0];
>   Form.focusFirstElement(firstForm);} );")
>
> no response, though. Please help
>
> Bob

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate