Re: [Rails] Doint something with each field in form as it is entered
On Sat, Jan 30, 2010 at 2:02 PM, Ralph Shnelvar <lists@ruby-forum.com> 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@googlegroups.com.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home