HTML form not posting dynamically added form elements

I debugged this one for hours, thinking it had something to do with my django formset code / dynamic handling of new entries.

It turns out the reason was casued by mismatching tag elements.

I two forms, one in a left column, and another larger full page form starting with the right column; thus I had a form element starting inside of a div block which wouldn’t be closed until the end of the page.

This caused the problem where the browser refused to POST the data.

This type of tag mismatch works if it’s rendered by the server, but not if you dynamically add the elements.

One thought on “HTML form not posting dynamically added form elements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s