Dave S wrote:
> It sounds like you want the default value to act sort of like a label,
> if so here's a little snippet I've used previously that works very
> nicely.
> 
> http://codesnippets.joyent.com/posts/show/478
> 
> Then format your input like this...
> 
> <%= form.text_field :email, :value => "[email protected]" onclick =>
> "clickclear(this, '[email protected]')" onblur => "clickrecall
> (this,'[email protected]'')" %>
> 
> Just be sure that the 3 values here are all identical.

I haven't looked at the snippet yet, but your last sentence is 
troublesome.  If it's important to have the same value in 3 places, then 
it should be set only once and referred to (in a variable, or with a 
higher level abstraction).  It is *never* OK to have the same literal 
value in 3 places like this.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to