On a form submit, I would like to throw a warning dialog (Are you sure? Yes | No - type) but based on the data entered in the form input fields. I looked at button_to and link_to but can''t seem to make them throw the dialog based on the data entered in the form? Any ideas appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hari Rajagopal wrote:> On a form submit, I would like to throw a warning dialog (Are you > sure? Yes | No - type) but based on the data entered in the form input > fields. > > I looked at button_to and link_to but can''t seem to make them throw > the dialog based on the data entered in the form? > > Any ideas appreciated.I think you''re getting two different design patterns confused here. A confirm dialog is just for dangerous operations where you want to make sure somebody doesn''t delete something important just because their motor skills are not up to par or they didn''t understand the label you chose for that link. If you want to look at the data and yell at the user based on what they typed, that is more like a validation in a model, where you would notice that they just tried to set next year as the year they were born and you would send them back to the form with an error message. Please send along some context and maybe we can steer you in the right direction. cheers, jp -- 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 -~----------~----~----~----~------~----~------~--~---
It is a reservation form and it has a start date field and an end date field. On form submit, I would like a warning to pop up if the span is more than a week just asking for confirmation from the user since it is not a common scenario, although it is perfectly ok to allow the user to reserve for a span more than a week. Hence I am unable to have a validation in the model. -Thanks On Jun 20, 6:49 pm, Jeff Pritchard <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hari Rajagopal wrote: > > On a form submit, I would like to throw a warning dialog (Are you > > sure? Yes | No - type) but based on the data entered in the form input > > fields. > > > I looked at button_to and link_to but can''t seem to make them throw > > the dialog based on the data entered in the form? > > > Any ideas appreciated. > > I think you''re getting two different design patterns confused here. A > confirm dialog is just for dangerous operations where you want to make > sure somebody doesn''t delete something important just because their > motor skills are not up to par or they didn''t understand the label you > chose for that link. > > If you want to look at the data and yell at the user based on what they > typed, that is more like a validation in a model, where you would notice > that they just tried to set next year as the year they were born and you > would send them back to the form with an error message. > > Please send along some context and maybe we can steer you in the right > direction. > > cheers, > jp > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---