元素输入在此处不允许的属性值(在表单上) [英] Attribute value not allowed on element input at this point (on a form)

查看:185
本文介绍了元素输入在此处不允许的属性值(在表单上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

W3C告诉我此时元素输入不允许属性值。我认为这是必要的形式?

 < input type =imagevalue =submitclass =no- bordersrc =assets / images / submit_btn.pngalt =submitname =submit/> 


解决方案

http://lists.w3.org/Archives/Public/www-validator/2010May/0025.html


浏览器对于发送服务器端图像映射的值不一致。有些浏览器发送它,有些只发送x / y坐标。这是一个非常可怜的想法,依靠它被发送。

[...]



从草稿HTML 5规范:



 元素的值属性必须省略。 

- http://www.w3.org/TR/html5/states-of-the-type-attribute.html#image-button-state-type-image
code>




所以这不是一个错误。我认为该属性是被禁止的,因为常见的当前浏览器无法实现它,因此虽然它将向后兼容HTML 4,但它在实践中与浏览器不兼容。



W3C tells me "Attribute value not allowed on element input at this point". I thought this was necessary for forms?

<input type="image" value="submit" class="no-border" src="assets/images/submit_btn.png" alt="submit" name="submit" /> 

解决方案

http://lists.w3.org/Archives/Public/www-validator/2010May/0025.html

Browsers are inconsistent about sending the value of server side image maps. Some browsers send it, some send only the x/y co-ordinates. It is a very poor idea to depend on it being sent.

[...]

From the draft HTML 5 specification:

The element's value attribute must be omitted.

— http://www.w3.org/TR/html5/states-of-the-type-attribute.html#image-button-state-type-image

So this is not a bug. I assume the attribute was forbidden because common current browsers fail to implement it so that while it would be backwards compatible with HTML 4, it is not compatible with browsers in practice.

这篇关于元素输入在此处不允许的属性值(在表单上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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