开发者

why does setting attribute "disabled" on a input text box stop that field from posting to the server when you submit a form?

if you set "disabled" on a input and submit a form, that field doesn't seem to be in the Request.Form when you post to the server.

What is the logic behind the design decision to not post this field solely based on some presentation layer decision?

T开发者_JAVA技巧his makes no sense to me . ..


Works as specified by the W3C (albeit a bit cryptical):

Disabled controls cannot be successful. [...]

A successful control is "valid" for submission

If you want to make an element unaccessible for the user, while sending along the value, use the readonly property.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜