Hello, I''ve made a form with a validation system in rails (validates_presence_of etc) but I''ld like also to make a classic validation with an external javascript to have a direct client validation without sending to the server. Is it possible? Thanks you for your help, -- 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-/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 -~----------~----~----~----~------~----~------~--~---
How about trying live validation? On Mon, May 19, 2008 at 2:58 AM, san 1981 <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hello, > > I''ve made a form with a validation system in rails > (validates_presence_of etc) but I''ld like also to make a classic > validation with an external javascript to have a direct client > validation without sending to the server. Is it possible? > > Thanks you for your help, > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ramon Tayag --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ramon Tayag wrote:> How about trying live validation? > > On Mon, May 19, 2008 at 2:58 AM, san 1981 > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> Posted via http://www.ruby-forum.com/. >>Thanks Tayag, I didn''t know live validation but that seems really interesting, I''ll try this. I''ve yet a question about the classic rails validation... When I add "validates_presence_of :email"; if the field "email" is empty, when the submitting I receive an error message " You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.collect''. If the field "email" is filled, the field with select .collect works perfectly? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
san 1981 wrote:> Ramon Tayag wrote: >> How about trying live validation? >> >> On Mon, May 19, 2008 at 2:58 AM, san 1981 >> <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >>> Posted via http://www.ruby-forum.com/. >>> > Thanks Tayag, I didn''t know live validation but that seems really > interesting, I''ll try this. > > I''ve yet a question about the classic rails validation... When I add > "validates_presence_of :email"; if the field "email" is empty, when the > submitting I receive an error message " You have a nil object when you > didn''t expect it! You might have expected an instance of Array. The > error occurred while evaluating nil.collect''. If the field "email" is > filled, the field with select .collect works perfectly?I''ll say that if the field "email" is filled, the form is well submitted. I received the error message only if this field is empty. -- 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-/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 -~----------~----~----~----~------~----~------~--~---