具有id属性的表单和具有表单属性的输入ie11问题 [英] form with id attribute and input with form attribute ie11 issue

查看:76
本文介绍了具有id属性的表单和具有表单属性的输入ie11问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这仅在ie11中发生,在chrome和ie8中工作正常

我已经编写了这样的代码

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

<input><form>标记之外,但除了在ie11中有效之外,其他功能都可以使用

除非我将<input>放在</form>之前,否则它可以在ie11中工作

奇怪的是,在ie11中,当我使用开发人员工具时,它会移动</form>,因此输入会在</form>之后出现,但它可以工作,但是如果我更改代码以匹配开发人员工具所说的失败 >

我做错了什么?为什么ie11不会将具有id属性的<form>接受具有与表单id相同的form属性的<input>?

解决方案

值得注意的是,Internet Explorer的最新版本(包括11)目前不支持使用位于外部的<input />元素上的form=""属性. <form>元素.

对于F12问题,这似乎是一个错误.我会让团队知道.

免责声明:我使用的是Internet Explorer

更新:我制作了jsFiddle的副本,其中删除了多余的<html> etc元素: http://jsfiddle.net/chris123/t4zd3p2b/2/,但是我无法重现"moving </form>"标记错误.您有精确的复制步骤吗?

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?

解决方案

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?

这篇关于具有id属性的表单和具有表单属性的输入ie11问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆