I''ve got an RJS response return content with <form> tags, I can see the form tags in the response from the server. But the Element.update() is removing them. Is this a new "feature"? Any way to disable this behavoir? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
i think i saw this before when I was trying to load a new form via ajax into an element that was already inside a form. On Tue, Feb 12, 2008 at 3:50 PM, Andy Koch <andy.koch-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> wrote:> > I''ve got an RJS response return content with <form> tags, I can see > the form tags in the response from the server. But the > Element.update() is removing them. > > Is this a new "feature"? Any way to disable this behavoir? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yes, that is what I want to do unfortunately Prototype is getting in the way... grrrr... On Feb 12, 1:02 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i think i saw this before when I was trying to load a new form via ajax into > an element that was already inside a form. > > On Tue, Feb 12, 2008 at 3:50 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> wrote: > > > I''ve got an RJS response return content with <form> tags, I can see > > the form tags in the response from the server. But the > > Element.update() is removing them. > > > Is this a new "feature"? Any way to disable this behavoir?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ok... let me ask you this.. why are you loading a form inside a form? I was doing it because I wasn''t thinking clearly.... you are trying to do it on purpose... why? On Tue, Feb 12, 2008 at 4:33 PM, Andy Koch <andy.koch-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> wrote:> > yes, that is what I want to do > > unfortunately Prototype is getting in the way... grrrr... > > On Feb 12, 1:02 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > i think i saw this before when I was trying to load a new form via ajax > into > > an element that was already inside a form. > > > > On Tue, Feb 12, 2008 at 3:50 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> > wrote: > > > > > I''ve got an RJS response return content with <form> tags, I can see > > > the form tags in the response from the server. But the > > > Element.update() is removing them. > > > > > Is this a new "feature"? Any way to disable this behavoir? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yes, I''m intending this, the inner form is temporary - when the outer form is submitted the inner form has been removed from the DOM that''s the idea anyway On Feb 12, 1:38 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ok... let me ask you this.. why are you loading a form inside a form? > > I was doing it because I wasn''t thinking clearly.... you are trying to do it > on purpose... why? > > On Tue, Feb 12, 2008 at 4:33 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> wrote: > > > yes, that is what I want to do > > > unfortunately Prototype is getting in the way... grrrr... > > > On Feb 12, 1:02 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > i think i saw this before when I was trying to load a new form via ajax > > into > > > an element that was already inside a form. > > > > On Tue, Feb 12, 2008 at 3:50 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> > > wrote: > > > > > I''ve got an RJS response return content with <form> tags, I can see > > > > the form tags in the response from the server. But the > > > > Element.update() is removing them. > > > > > Is this a new "feature"? Any way to disable this behavoir?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ok, so you intend for your dom to look like <form name="sth" action="somepage.php"> <input .... /> <form name="tempsth" action="someotherpage.php"> <input .... /> </form> <input ..../> </form> do you see why that doesn''t make sense? if not, what are you trying to accomplish with the temporary form? load more data via ajax? On Tue, Feb 12, 2008 at 4:42 PM, Andy Koch <andy.koch-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> wrote:> > yes, I''m intending this, the inner form is temporary - when the outer > form is submitted the inner form has been removed from the DOM > > that''s the idea anyway > > On Feb 12, 1:38 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > ok... let me ask you this.. why are you loading a form inside a form? > > > > I was doing it because I wasn''t thinking clearly.... you are trying to > do it > > on purpose... why? > > > > On Tue, Feb 12, 2008 at 4:33 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> > wrote: > > > > > yes, that is what I want to do > > > > > unfortunately Prototype is getting in the way... grrrr... > > > > > On Feb 12, 1:02 pm, "Brian Williams" <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > i think i saw this before when I was trying to load a new form via > ajax > > > into > > > > an element that was already inside a form. > > > > > > On Tue, Feb 12, 2008 at 3:50 PM, Andy Koch <andy.k...-sBIqA0PYact54TAoqtyWWQ@public.gmane.org> > > > wrote: > > > > > > > I''ve got an RJS response return content with <form> tags, I can > see > > > > > the form tags in the response from the server. But the > > > > > Element.update() is removing them. > > > > > > > Is this a new "feature"? Any way to disable this behavoir? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You cannot have a form in a form, you''re probably doing a page.replace_html ''form_id'', :partial => ''form_partial'' which is causing this situation. You need to have an inner div with a unique ID and a partial for the form contents that you will replace. Something like: <form id="foo"> <div id="foo_contents"> <!-- form fields go here, this content should come from a partial --> </div> </form> Then in your RJS: page.replace_html ''foo_contents'', :partial => ''partial_with_foo_contents'' Boy, lots of Rails questions on the Javascript list today ;) -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yes, that is what I did, more or less replaced the inner form tags with div tags and rewrote my JS with some DOM trickery to acheive the same result thanks guys On Feb 12, 2:14 pm, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You cannot have a form in a form, you''re probably doing a > page.replace_html ''form_id'', :partial => ''form_partial'' which is > causing this situation. You need to have an inner div with a unique ID > and a partial for the form contents that you will replace. Something > like: > > <form id="foo"> > <div id="foo_contents"> > <!-- form fields go here, this content should come from a partial --> > </div> > </form> > > Then in your RJS: > > page.replace_html ''foo_contents'', :partial => ''partial_with_foo_contents'' > > Boy, lots of Rails questions on the Javascript list today ;) > > -justin--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---