I have several fields in a form that contain placeholder text prior to the user populating it with their own data. It''s just a mix of javascript onfocus/onblur tags to show/hide the placeholder text. I''m looking for suggestions on a DRY way of preventing the placeholder text from being saved to the database without having to check each field manually. Any suggestions would be appreciated. Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Anyone? - j On Jun 28, 3:22 pm, Justin Williams <carpea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have several fields in a form that contain placeholder text prior to > the user populating it with their own data. It''s just a mix of > javascript onfocus/onblur tags to show/hide the placeholder text. I''m > looking for suggestions on a DRY way of preventing the placeholder > text from being saved to the database without having to check each > field manually. > > Any suggestions would be appreciated. > > Thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Justin, I think a Javascript helper method which attachs to the submit event of the form would be DRYest. It could even borrow some code from the functionality that shows/hides the placeholder text. On 7/2/07, Justin Williams <carpeaqua-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Anyone? > > - j > > On Jun 28, 3:22 pm, Justin Williams <carpea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I have several fields in a form that contain placeholder text prior to > > the user populating it with their own data. It''s just a mix of > > javascript onfocus/onblur tags to show/hide the placeholder text. I''m > > looking for suggestions on a DRY way of preventing the placeholder > > text from being saved to the database without having to check each > > field manually. > > > > Any suggestions would be appreciated. > > > > Thanks > > > > >-- Manik J. company: http://vinsol.com blog: http://fromdelhi.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 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 -~----------~----~----~----~------~----~------~--~---