I have a Form which contains another form.
When I’m submitting the nested form through javascript, It is submitting twice in Internet Explorer, but only one in any other browser.
How to submit the nested form to send only one request in IE.
Edit:
I’m using onchange event to submit the nested form.. so how the click can work in my case?
You really shouldn’t be nesting forms, but you can stop the propagation of the event. For instance, if your
clickevent is submitting the outside form, do the following:Be sure to read the notes regarding event delegation.
Also, it’s not necessary to nest forms. You can have a submit button within one form submit an entirely different form if you like; just use the
formattribute on the button itself:I should note that the
formattribute isn’t supported like this in Internet Explorer 10. You could patch this logic though with some simple logic like this: