laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Feb-04 15:28 UTC
creating text field where text disappears upon click
Hi, Is there a slick way in Rails to create a username text field in which it starts out reading, "Enter your username" and once you click on the text field, the "Enter your username" text disappears? Thanks, - Dave --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I don''t know of a slick way (yet) but here''s the HTML to produce said results <input type="text" name="name" value="Enter your name" onclick="if(this.value==''Enter your name'')this.value='''';"> On Feb 4, 9:28 am, "laredotorn...-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org" <laredotorn...-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org> wrote:> Hi, > > Is there a slick way in Rails to create a username text field in which > it starts out reading, "Enter your username" and once you click on the > text field, the "Enter your username" text disappears? > > Thanks, - Dave--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---