then, in my FORM there are 2 buttoms : first to select a file to upload buttom="Parcourir" second to send the complete Form, buttom="ENVOYER" "parcourir" is for to select a file to upload but "ENVOYER" must validate the complete Form : - file selected presence - other fields validatation if evrything is OK, i have to upload the file (and save it) and update a Table how can i do this ? Attachments: http://www.ruby-forum.com/attachment/2953/ex.doc -- 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 -~----------~----~----~----~------~----~------~--~---
You could use javascript to change the target of your form when they click either button. This can get messy though. Each different form target can have it''s own validation. -Jim http://jim-rants.com/coding-blog/ On Thu, Nov 20, 2008 at 3:48 PM, Xd Xd <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > then, in my FORM there are 2 buttoms : > > first to select a file to upload buttom="Parcourir" > second to send the complete Form, buttom="ENVOYER" > > "parcourir" is for to select a file to upload > > but "ENVOYER" must validate the complete Form : > - file selected presence > - other fields validatation > > if evrything is OK, i have to upload the file (and save it) > and update a Table > > > how can i do this ? > > Attachments: > http://www.ruby-forum.com/attachment/2953/ex.doc > > -- > 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 -~----------~----~----~----~------~----~------~--~---
I guess you want to diferenciate clicks to different submit buttons. I did it like this: <%= image_submit_tag(''add_16.png'', :name => "action_categories/new") %> By specifiing name you can differenciate in controller which button was selected. params.each do |e| if e[0][0,7] == ''action_'' ctrl, action = e[0][7,100].split(''/'') action ||= ''index'' break end end The example shows which controller/action call when submit button is pressed. by TheR -- 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 -~----------~----~----~----~------~----~------~--~---
On 20 Nov 2008, at 20:48, Xd Xd wrote:> > then, in my FORM there are 2 buttoms : > > first to select a file to upload buttom="Parcourir" > second to send the complete Form, buttom="ENVOYER" > > "parcourir" is for to select a file to upload >Isn''t this button just going to come "for free" was part of the file upload tag? Fred> but "ENVOYER" must validate the complete Form : > - file selected presence > - other fields validatation > > if evrything is OK, i have to upload the file (and save it) > and update a Table > > > how can i do this ? > > Attachments: > http://www.ruby-forum.com/attachment/2953/ex.doc > > -- > 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 -~----------~----~----~----~------~----~------~--~---