Marnen Laibow-Koser wrote in post #955835: > Leonel *.* wrote in post #955832: >> I know how to use the form helpers to create forms. >> >> What I want to accomplish is something similar to the LOCATION field at >> www.krop.com Do you see how it reads Live Search inside the box? As soon >> as you click on it, it disappears allowing you to enter your search >> terms. > > I see that. That can be accomplished with simple JavaScript. And now I > understand why you need something beyond plain HTML. > >> >> How can I accomplish the onclick="" event with a form helper in Rails or >> some other Rails way? >> >> I have a login form: Username and Password. The Username field is >> supposed to say "Username" and when you click on the field "Username" >> disappears, allowing you to enter the Username. > > Those two paragraphs are an exact repeat of an earlier post. There is > no reason to do that. > > You have created for yourself a technical surrogate goal (the onclick > event) that may or may not be related to your real goal (have default > text in your search box). > > In any event, the answer is, I think, that you need to learn JavaScript > to do this (do you know JavaScript yet?). Rails doesn't provide a > canned helper for this AFAIK, but even if it does, you should understand > what it's doing. > > Are you using Prototype, jQuery, or some other JS framework on your > project? A quick Google search turned up > http://sourceforge.net/projects/input-default/ for Prototype and > http://plugins.jquery.com/project/defaultInputText for jQuery.
Yes, I know JavaScript. I just thought there might be some magic Rails way to accomplish that task. But if there is not, its ok, I'll just try something else. I've been using jQuery but I notice lots of Rails developers use Prototype, is there a special reason for this? -- Posted via http://www.ruby-forum.com/. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

