How to fix strangely disappearing or misbehaving forms

Updated . Posted . Visible to the public.

You most likely have a form element inside another form element. Don't do that. Ever.

Firefox and Chrome will discard the first form nested inside another form (but for some reason keep others). Internet Explorer will possibly act like nothing is wrong -- but break (send the outer form) when you submit.

If your application behaves normal at first but removes forms from the DOM when you Ajax around, this could be the cause. Remember this note when you think your browsers are broken once again and check for such things thoroughly before heading into the depths of Rails or your application's logic.

Arne Hartherz
Last edit
Keywords
errors, xhr, XMLHttpRequest
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-04-18 18:20)