Hi to all, I''d like to pass with a link to values inside some form. I''ve read in other posts that it''s possible if i include the forms inside a html <div>... So here it''s my code of the view : <div id="study"> <table> <tr><td><label for="study_titolo">Titolo di studio</label></td></tr> <tr><td><label for="study_istituto">Istituto</label></td><td><label for="study_conseguito">Data di conseguimento</label></td><td><label for="study_voto">Voto/giudizio</label></td></tr> <tr><td><%= text_field ''study'', ''istituto''%></td><td><%date_select ''study'', ''conseguito'', {:include_blank => true}%></td><td><%= text_field ''study'', ''voto''%></td></tr> </table> </div> <%=link_to "Aggiungi", { :controller => "studies", :action=> "create", :id_nominee => @nominee.id, :study => @study}, :submit => ''study'', :html => { :method => :post} %> where in submit value of Link_to i''ve specified the div id. When i click on link_to no forms values are passed.... Can somebody help me?????? -- 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 Oct 31, 9:38 am, Andrea Campagna <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi to all, > > I''d like to pass with a link to values inside some form. I''ve read in > other posts that it''s possible if i include the forms inside a html > <div>...That sounds made up to me. Links (without javascript help) don''t submit forms. if you have to have a link that submits a form, by far the easiest way is to have a link whose onclick is $ (''some_form'').submit() (link_to_function makes this easy). Fred> So here it''s my code of the view : > > <div id="study"> > <table> > <tr><td><label for="study_titolo">Titolo di > studio</label></td></tr> > <tr><td><label > for="study_istituto">Istituto</label></td><td><label > for="study_conseguito">Data di conseguimento</label></td><td><label > for="study_voto">Voto/giudizio</label></td></tr> > <tr><td><%= text_field ''study'', ''istituto''%></td><td><%> date_select ''study'', ''conseguito'', {:include_blank => > true}%></td><td><%= text_field ''study'', ''voto''%></td></tr> > </table> > </div> > > <%=link_to "Aggiungi", { :controller => "studies", :action=> "create", > :id_nominee => @nominee.id, :study => @study}, :submit => ''study'', :html > => { :method => :post} %> > > where in submit value of Link_to i''ve specified the div id. > When i click on link_to no forms values are passed.... > Can somebody help me?????? > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Oct 31, 9:38�am, Andrea Campagna <rails-mailing-l...@andreas-s.net> > wrote: >> Hi to all, >> >> I''d like to pass with a link to values inside some form. I''ve read in >> other posts that it''s possible if i include the forms inside a html >> <div>... > > That sounds made up to me. Links (without javascript help) don''t > submit forms. if you have to have a link that submits a form, by far > the easiest way is to have a link whose onclick is $ > (''some_form'').submit() (link_to_function makes this easy). > > Fredhi Fred, this is the topic http://www.ruby-forum.com/topic/146247#new where i''ve read the suggestion... So i was searching the right syntax for doing that, i''ll try to know more about link_to_function, but i''d like to know if it''s really possible in the other way, cause i''ve found more than one person that suggest that way... Tanks for your reply Andrea -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 31 Oct 2008, at 09:56, Andrea Campagna wrote:> > Frederick Cheung wrote: >> On Oct 31, 9:38�am, Andrea Campagna <rails-mailing-l...@andreas- >> s.net> >> wrote: >>> Hi to all, >>> >>> I''d like to pass with a link to values inside some form. I''ve read >>> in >>> other posts that it''s possible if i include the forms inside a html >>> <div>... >> >> That sounds made up to me. Links (without javascript help) don''t >> submit forms. if you have to have a link that submits a form, by far >> the easiest way is to have a link whose onclick is $ >> (''some_form'').submit() (link_to_function makes this easy). >> >> Fred > > hi Fred, > this is the topic http://www.ruby-forum.com/topic/146247#new where > i''ve > read the suggestion...That''s just wrong. Probably confused by the fact that link_to_remote does take a :submit option (which should be the id of a form element) Fred> > So i was searching the right syntax for doing that, i''ll try to know > more about link_to_function, but i''d like to know if it''s really > possible in the other way, cause i''ve found more than one person that > suggest that way... > Tanks for your reply> Andrea > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrea Campagna wrote:> <%=link_to "Aggiungi", { :controller => "studies", :action=> "create", > :id_nominee => @nominee.id, :study => @study}, :submit => ''study'', :html > => { :method => :post} %> > > where in submit value of Link_to i''ve specified the div id. > When i click on link_to no forms values are passed.... > Can somebody help me??????I am doing the exact thing that you are asking about the only difference is that I am using a link_to_remote, here is my code: <%= link_to_remote(''<span>Save</span>'', {:submit => "car_prefs", :update => ''account_car_prefs'', :complete => ''new Effect.Pulsate(\''account_car_prefs\'');'', :url => {:action => ''car_prefs'', :id => @account.id}}, :class => "squarebutton") %> My car_prefs div encapsulates all the textfields and dropdowns and then the :complete just updates another div - account_car_prefs - when the action has completed. You might also try looking at the source to make sure that the html is being generated properly, I say this because it seems more often then not, for me, that I always get the { } put in the wrong place when using additional options and you can also tell if you are using them wrong because the html doesn''t get formed right. -S -- 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> <%= link_to_remote(''<span>Save</span>'', > {:submit => "car_prefs", :update => ''account_car_prefs'', > :complete => ''new Effect.Pulsate(\''account_car_prefs\'');'', > :url => {:action => ''car_prefs'', :id => @account.id}}, > :class => "squarebutton") %> > > My car_prefs div encapsulates all the textfields and dropdowns and then > the :complete just updates another div - account_car_prefs - when the > action has completed. You might also try looking at the source to make > sure that the html is being generated properly, I say this because it > seems more often then not, for me, that I always get the { } put in the > wrong place when using additional options and you can also tell if you > are using them wrong because the html doesn''t get formed right. > > -SHi Shandy, really thanks for your reply.... NOw it works!!! I was really SAD for the first answer :D now i''m better -- 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 31 Oct 2008, at 15:19, Andrea Campagna wrote:> > Shandy Nantz wrote: > >> <%= link_to_remote(''<span>Save</span>'', >> {:submit => "car_prefs", :update => ''account_car_prefs'', >> :complete => ''new Effect.Pulsate(\''account_car_prefs\'');'', >> :url => {:action => ''car_prefs'', :id => @account.id}}, >> :class => "squarebutton") %> >> >> My car_prefs div encapsulates all the textfields and dropdowns and >> then >> the :complete just updates another div - account_car_prefs - when the >> action has completed. You might also try looking at the source to >> make >> sure that the html is being generated properly, I say this because it >> seems more often then not, for me, that I always get the { } put in >> the >> wrong place when using additional options and you can also tell if >> you >> are using them wrong because the html doesn''t get formed right. >> >> -S > > Hi Shandy, > > really thanks for your reply.... NOw it works!!! > I was really SAD for the first answer :D now i''m betterJust so you''re aware, the above does rely on javascript and the prototype libraries - it won''t work without javascript. Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---