sam
2007-Mar-17 11:41 UTC
Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
Hello all, I''m having the following problem with Safari: I have input type="hidden" fields inside li-elements whose order I edit using drag and drop. When submitting the form, Safari submits the list in the original order as listed in the page source, not the dynamically created new order. The whole thing works as expected in Firefox. Does anyone know how to resolve this problem? Thank you! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
James Mitchell
2007-Mar-17 16:25 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
On a post,browsers are not supposed to honor any specific ordering of inputs on the page. If you find one that does, great, but you can''t assume that this will work on them all. You''ll need to manage ordering with input values instead of visual ordering. Instead of manipulating the order, try manipulating a set of corresponding hidden inputs that hold the order number. -- James Mitchell The Ruby Roundup http://www.rubyroundup.com/ On Mar 17, 2007, at 7:41 AM, sam wrote:> > Hello all, > > I''m having the following problem with Safari: I have input > type="hidden" fields inside li-elements whose order I edit using drag > and drop. When submitting the form, Safari submits the list in the > original order as listed in the page source, not the dynamically > created new order. The whole thing works as expected in Firefox. Does > anyone know how to resolve this problem? > > Thank you! > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
sam
2007-Mar-17 16:30 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
That is very inconvenient, but makes sense. Thank you. On Mar 17, 5:25 pm, James Mitchell <edgetechservices....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On a post,browsers are not supposed to honor any specific ordering of > inputs on the page. If you find one that does, great, but you can''t > assume that this will work on them all. > > You''ll need to manage ordering with input values instead of visual > ordering. Instead of manipulating the order, try manipulating a set > of corresponding hidden inputs that hold the order number. > > -- > James Mitchell > The Ruby Rounduphttp://www.rubyroundup.com/ > > On Mar 17, 2007, at 7:41 AM, sam wrote: > > > > > Hello all, > > > I''m having the following problem with Safari: I have input > > type="hidden" fields inside li-elements whose order I edit using drag > > and drop. When submitting the form, Safari submits the list in the > > original order as listed in the page source, not the dynamically > > created new order. The whole thing works as expected in Firefox. Does > > anyone know how to resolve this problem? > > > Thank you!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
James Mitchell
2007-Mar-17 17:00 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
I know, and if you look at the spec: http://www.w3.org/TR/html4/interact/forms.html#didx-applicationx- www-form-urlencoded "The control names/values are listed in the order they appear in the document." ...and right after that in the multi part section, they reference it as "document stream"... So, I''m not sure about the specific interpretation of whether style and/or dom manipulation actually affects the "document" or "document stream". -- James Mitchell The Ruby Roundup http://www.rubyroundup.com/ On Mar 17, 2007, at 12:30 PM, sam wrote:> > That is very inconvenient, but makes sense. Thank you. > > On Mar 17, 5:25 pm, James Mitchell <edgetechservices....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On a post,browsers are not supposed to honor any specific ordering of >> inputs on the page. If you find one that does, great, but you can''t >> assume that this will work on them all. >> >> You''ll need to manage ordering with input values instead of visual >> ordering. Instead of manipulating the order, try manipulating a set >> of corresponding hidden inputs that hold the order number. >> >> -- >> James Mitchell >> The Ruby Rounduphttp://www.rubyroundup.com/ >> >> On Mar 17, 2007, at 7:41 AM, sam wrote: >> >> >> >>> Hello all, >> >>> I''m having the following problem with Safari: I have input >>> type="hidden" fields inside li-elements whose order I edit using >>> drag >>> and drop. When submitting the form, Safari submits the list in the >>> original order as listed in the page source, not the dynamically >>> created new order. The whole thing works as expected in Firefox. >>> Does >>> anyone know how to resolve this problem? >> >>> Thank you! > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Tom Gregory
2007-Mar-18 21:44 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
Sam, You may want to look at Sortable.serialize and SortableObserver. These would obviate the need for hidden input fields to determine order. http://wiki.script.aculo.us/scriptaculous/show/Sortable.serialize Take a look in dragdrop.js to see how the Sortable Observer is used. TAG On Mar 17, 2007, at 10:25 AM, James Mitchell wrote:> > On a post,browsers are not supposed to honor any specific ordering of > inputs on the page. If you find one that does, great, but you can''t > assume that this will work on them all. > > You''ll need to manage ordering with input values instead of visual > ordering. Instead of manipulating the order, try manipulating a set > of corresponding hidden inputs that hold the order number. > > > > > -- > James Mitchell > The Ruby Roundup > http://www.rubyroundup.com/ > > > On Mar 17, 2007, at 7:41 AM, sam wrote: > >> >> Hello all, >> >> I''m having the following problem with Safari: I have input >> type="hidden" fields inside li-elements whose order I edit using drag >> and drop. When submitting the form, Safari submits the list in the >> original order as listed in the page source, not the dynamically >> created new order. The whole thing works as expected in Firefox. Does >> anyone know how to resolve this problem? >> >> Thank you! >> >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
sam
2007-Apr-11 17:06 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
I solved it by calling a function on Sortable.onChange that renames my arrayName[n] fields according to their current position in the DOM. Seemed to be a simple and degradable solution. On Mar 18, 11:44 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> Sam, > > You may want to look at Sortable.serialize and SortableObserver. > These would obviate the need for hidden input fields to determine order.http://wiki.script.aculo.us/scriptaculous/show/Sortable.serialize > > Take a look in dragdrop.js to see how the Sortable Observer is used. > > TAG > > On Mar 17, 2007, at 10:25 AM, James Mitchell wrote: > > > > > On a post,browsers are not supposed to honor any specific ordering of > > inputs on the page. If you find one that does, great, but you can''t > > assume that this will work on them all. > > > You''ll need to manage ordering with input values instead of visual > > ordering. Instead of manipulating the order, try manipulating a set > > of corresponding hidden inputs that hold the order number. > > > -- > > James Mitchell > > The Ruby Roundup > >http://www.rubyroundup.com/ > > > On Mar 17, 2007, at 7:41 AM, sam wrote: > > >> Hello all, > > >> I''m having the following problem with Safari: I have input > >> type="hidden" fields inside li-elements whose order I edit using drag > >> and drop. When submitting the form, Safari submits the list in the > >> original order as listed in the page source, not the dynamically > >> created new order. The whole thing works as expected in Firefox. Does > >> anyone know how to resolve this problem? > > >> Thank you!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Tom Gregory
2007-Apr-11 18:17 UTC
Re: Reordering hidden inputs with Scriptaculous Drag & Drop, Safari but submits original order
You''ll want to make sure it works in IE. Unfortunately, IE considers the "name" property to be writable only at the time an element is created, and doesn''t handle name changes well. TAG On Apr 11, 2007, at 11:06 AM, sam wrote:> > I solved it by calling a function on Sortable.onChange that renames my > arrayName[n] fields according to their current position in the DOM. > Seemed to be a simple and degradable solution.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---