Hi, I''m trying to submit a form onDrop using Scriptaculous. I have a small form with a multi-select box. My form is just a standard HTML form, but it doesn''t have a submit button. <form action="/projects/multi_drop" id="multi_drop_form_<%attribute.id.to_s %>" method="post"> ... select box ... </form> My droppable element is created like this: <%= drop_receiving_element ''multi_drop_''+attribute.id.to_s, :accept => ''group'', :onDrop => "function(element) { $(''multi_drop_form_# {attribute.id.to_s}'').request({parameters:{id:element}}); } " %> As you can see, what I''m trying to do is submit a form and send the id of the dragged element along with it as the id. But when I look in Firebug, it doesn''t POST at all! No id, but also no values from the select box. What am I doing wrong? Ondrop forms aren''t really documented anywhere, but I thought I figured it out! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
jhaagmans
2009-Dec-01 14:25 UTC
Re: Submitting a form onDrop, parameters don''t come through
I may have been unclear about this: it does make a POST request to the action URL, but the POST data is empty. This results, of course, in the controller failing to process the data. On 1 dec, 13:32, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''m trying to submit a form onDrop using Scriptaculous. I have a small > form with a multi-select box. My form is just a standard HTML form, > but it doesn''t have a submit button. > > <form action="/projects/multi_drop" id="multi_drop_form_<%> attribute.id.to_s %>" method="post"> > ... > select box > ... > </form> > > My droppable element is created like this: > > <%= drop_receiving_element ''multi_drop_''+attribute.id.to_s, :accept => > ''group'', :onDrop => "function(element) { $(''multi_drop_form_# > {attribute.id.to_s}'').request({parameters:{id:element}}); } " %> > > As you can see, what I''m trying to do is submit a form and send the id > of the dragged element along with it as the id. But when I look in > Firebug, it doesn''t POST at all! No id, but also no values from the > select box. > > What am I doing wrong? Ondrop forms aren''t really documented anywhere, > but I thought I figured it out!-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
jhaagmans
2009-Dec-01 19:57 UTC
Re: Submitting a form onDrop, parameters don''t come through
What surprises me the most is that it submits the form (it sends a POST request to the right place), but it doesn''t submit form data. Why is that? I hope someone can help, I''m stuck. On 1 dec, 15:25, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I may have been unclear about this: it does make a POST request to the > action URL, but the POST data is empty. This results, of course, in > the controller failing to process the data. > > On 1 dec, 13:32, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I''m trying to submit a form onDrop using Scriptaculous. I have a small > > form with a multi-select box. My form is just a standard HTML form, > > but it doesn''t have a submit button. > > > <form action="/projects/multi_drop" id="multi_drop_form_<%> > attribute.id.to_s %>" method="post"> > > ... > > select box > > ... > > </form> > > > My droppable element is created like this: > > > <%= drop_receiving_element ''multi_drop_''+attribute.id.to_s, :accept => > > ''group'', :onDrop => "function(element) { $(''multi_drop_form_# > > {attribute.id.to_s}'').request({parameters:{id:element}}); } " %> > > > As you can see, what I''m trying to do is submit a form and send the id > > of the dragged element along with it as the id. But when I look in > > Firebug, it doesn''t POST at all! No id, but also no values from the > > select box. > > > What am I doing wrong? Ondrop forms aren''t really documented anywhere, > > but I thought I figured it out! > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
jhaagmans
2009-Dec-01 20:07 UTC
Re: Submitting a form onDrop, parameters don''t come through
Errm... That problem''s fixed now, sorry. I had the form outside two containing TD tags, but it should have been inside that around the select tag. However, the parameters still don''t get posted and I don''t know what I''m doing wrong. On 1 dec, 20:57, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What surprises me the most is that it submits the form (it sends a > POST request to the right place), but it doesn''t submit form data. Why > is that? > > I hope someone can help, I''m stuck. > > On 1 dec, 15:25, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I may have been unclear about this: it does make a POST request to the > > action URL, but the POST data is empty. This results, of course, in > > the controller failing to process the data. > > > On 1 dec, 13:32, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > I''m trying to submit a form onDrop using Scriptaculous. I have a small > > > form with a multi-select box. My form is just a standard HTML form, > > > but it doesn''t have a submit button. > > > > <form action="/projects/multi_drop" id="multi_drop_form_<%> > > attribute.id.to_s %>" method="post"> > > > ... > > > select box > > > ... > > > </form> > > > > My droppable element is created like this: > > > > <%= drop_receiving_element ''multi_drop_''+attribute.id.to_s, :accept => > > > ''group'', :onDrop => "function(element) { $(''multi_drop_form_# > > > {attribute.id.to_s}'').request({parameters:{id:element}}); } " %> > > > > As you can see, what I''m trying to do is submit a form and send the id > > > of the dragged element along with it as the id. But when I look in > > > Firebug, it doesn''t POST at all! No id, but also no values from the > > > select box. > > > > What am I doing wrong? Ondrop forms aren''t really documented anywhere, > > > but I thought I figured it out! > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
jhaagmans
2009-Dec-01 20:34 UTC
Re: Submitting a form onDrop, parameters don''t come through
Well, it took some time, but I figured it out. element should be element.id of course. Argh! On 1 dec, 21:07, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Errm... That problem''s fixed now, sorry. I had the form outside two > containing TD tags, but it should have been inside that around the > select tag. However, the parameters still don''t get posted and I don''t > know what I''m doing wrong. > > On 1 dec, 20:57, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > What surprises me the most is that it submits the form (it sends a > > POST request to the right place), but it doesn''t submit form data. Why > > is that? > > > I hope someone can help, I''m stuck. > > > On 1 dec, 15:25, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I may have been unclear about this: it does make a POST request to the > > > action URL, but the POST data is empty. This results, of course, in > > > the controller failing to process the data. > > > > On 1 dec, 13:32, jhaagmans <jaap.haagm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > > I''m trying to submit a form onDrop using Scriptaculous. I have a small > > > > form with a multi-select box. My form is just a standard HTML form, > > > > but it doesn''t have a submit button. > > > > > <form action="/projects/multi_drop" id="multi_drop_form_<%> > > > attribute.id.to_s %>" method="post"> > > > > ... > > > > select box > > > > ... > > > > </form> > > > > > My droppable element is created like this: > > > > > <%= drop_receiving_element ''multi_drop_''+attribute.id.to_s, :accept => > > > > ''group'', :onDrop => "function(element) { $(''multi_drop_form_# > > > > {attribute.id.to_s}'').request({parameters:{id:element}}); } " %> > > > > > As you can see, what I''m trying to do is submit a form and send the id > > > > of the dragged element along with it as the id. But when I look in > > > > Firebug, it doesn''t POST at all! No id, but also no values from the > > > > select box. > > > > > What am I doing wrong? Ondrop forms aren''t really documented anywhere, > > > > but I thought I figured it out! > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.