开发者

Why does input with property disabled set to disabled is not submitted?

I have a form where some input elements' disabled property set to disabled. I noticed that with the presence of disabled=disabled, th开发者_StackOverflowey are not submitted on the server. Why does it behave like that?


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.

    (from http://www.w3.org/TR/html4/interact/forms.html#h-17.12)

You should use readonly=readonly if you want their values submitted on the server.


Because that is what disabled is supposed to do. It effectively removes a control from the form while leaving a visible placeholder.

Perhaps you want readonly instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜