form with id attribute and input with form attribute ie11 issue

有些话、适合烂在心里 提交于 2019-12-12 04:52:51

问题


This only happens in ie11, this works fine in chrome and ie8

I have code programmed like this

<form .... id='mainform'>
<table>...</>
....
<button>....
....
</form>
<input form='mainform' ... >...

The <input> is outside the <form> tags but it works except in ie11

unless i put the <input> before the </form> then it works in ie11

the odd thing is in ie11 when i use developer tools it moves the </form> so the input comes after the </form> except it works, but if i change the code to match what the developer tools says it fails

What am I doing wrong? why wont ie11 have a <form> with an id attribute accept <input> with a form attribute the same as the form id?


回答1:


Of note, Internet Explorer up-to-and-including version 11 does not currently support using the form="" attribute on <input /> elements located outside of a <form> element.

As for the F12 issue, that looks like a bug. I'll let the team know.

Disclaimer: I work on Internet Explorer

Update I've made a copy of your jsFiddle with the extra <html> etc elements removed: http://jsfiddle.net/chris123/t4zd3p2b/2/ however I cannot reproduce the "moving </form>" tag bug. Do you have precise reproduction steps?



来源:https://stackoverflow.com/questions/26380551/form-with-id-attribute-and-input-with-form-attribute-ie11-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!