On Wed, Apr 2, 2008 at 9:30 AM, Tarscher
<tarscher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> i want to select text in an input field when a page is loaded.
document.observe(''dom:loaded'', function() {
// if you want the value:
var value = $F(''input-id'');
// if you want the input element to have focus (with its text selected):
$(''input-id'').activate();
});
> Can i use RJS for this?
Presumably, but I don''t know the syntax for that. Good luck!
:Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---