微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

表单提交 – 不提交已禁用输入的值?

这是我在firefox中找到的fireBug。

在其他浏览器中是否相同?

如果是这样,原因是什么?

解决方法

是的,所有浏览器都不应该提交禁用的输入,因为它们是只读的。

More info(第17.12.1节)

Attribute deFinitions

disabled [CI] When set for a form control,this boolean attribute
disables the control for user input. When set,the disabled attribute
has the following effects on an element:

  • disabled controls do not receive focus.
  • disabled controls are skipped in tabbing navigation.
  • disabled controls cannot be successful.

The following elements support the disabled attribute: BUTTON,INPUT,
OPTGROUP,OPTION,SELECT,and TEXTAREA.

This attribute is inherited but local declarations override the
inherited value.

How disabled elements are rendered depends on the user agent. For
example,some user agents “gray out” disabled menu items,button
labels,etc.

In this example,the INPUT element is disabled. Therefore,it cannot
receive user input nor will its value be submitted with the form.

06000

Note. The only way to modify dynamically the value of the disabled attribute is through a script.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐