Ralph Shnelvar
2010-Jan-30 19:02 UTC
Doint something with each field in form as it is entered
Is there a callback or some mechanism that will allow me to modify a view once a field in a form is finished .... asumming that there are multiple fields in a form. As a silly example, let''s say the bacground of the filed is white by default ... but once the user goes on to the next field, then make the background of that field red if the number of characters in the field is even. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rick DeNatale
2010-Jan-30 21:41 UTC
Re: Doint something with each field in form as it is entered
On Sat, Jan 30, 2010 at 2:02 PM, Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Is there a callback or some mechanism that will allow me to modify a > view once a field in a form is finished .... asumming that there are > multiple fields in a form. > > As a silly example, let''s say the bacground of the filed is white by > default ... but once the user goes on to the next field, then make the > background of that field red if the number of characters in the field is > even.Well this would almost certainly have to be done in the browser using JavaScript so it''s not really a Rails question. Most Rails apps use either the Prototype JavaScript framework (since that''s what the ajax helpers use), although the modern trend seems to be to use jQuery (and Rails 3 will make changing JavaScript frameworks much easier). If you google for prototype field validation and jquery field validation you''ll come up with serveral plugins for both frameworks. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.