Dynamically added form elements are not POSTED in IE 9

后端 未结 5 1899
南旧
南旧 2021-01-14 19:29

I have a form which is used to make a Test. User enter a question and provides question type and the Answer options and saves the Question. What has gone wrong is that when

相关标签:
5条回答
  • 2021-01-14 20:06

    When I test your code in IE9, it does include the fields in the POST data.

    Fiddle: http://jsfiddle.net/Guffa/AeBdd/

    I recreated the form and the fields from what the scripts needs. You should check if there is any relevant differences to the form and fields that you have.

    Note that I had to add a property crt_question to the document object, as the form is not automatically added, either with that id or name. Do you render your page in Quirks mode? That might cause some problems.

    0 讨论(0)
  • 2021-01-14 20:12

    I just encountered this same issue. In only ie9 dynamically loaded AJAX input elements were not posting on submit -- onload created inputs would post fine. What ended up being the problem for me was a missing opening body tag.

    0 讨论(0)
  • 2021-01-14 20:13

    It is possible that you have some improper HTML. For example, a kinda random possibility that was a symptom of this and worked for me: Try changing your <div> to a <span>.

    I was having the same issue with using innerHTML to insert HTML data into a div but IE9 not recognizing it. Even if I tried to just alert the field value it didn't know it existed even though it worked fine on IE8, Chrome, etc. But I changed the <div> to a <span> and voila, it understood perfectly.

    As it turned out, I had some improper HTML syntax. Specifically, my <form> tag was inside a <p> tag. Unlike all the other browsers, IE9 did not forgive this and only understood my inserted elements when they were inside p > form > span instead of a p > form > div. Of course the real solution was to correct my HTML structure. Then IE9 understood the <div> as well as the <span>.

    0 讨论(0)
  • 2021-01-14 20:17

    The same issue, the problem was missing body tag on document.

    0 讨论(0)
  • 2021-01-14 20:19

    That issue was totally due to the IE9 Standards. In the compatibility view the error was removed. So if any one comes across this type of issue just add the following line in the head section of your document: <meta http-equiv="X-UA-Compatible" content="IE=8" />

    0 讨论(0)
提交回复
热议问题