已禁用的表单字段未提交数据 [英] Disabled form fields not submitting data

查看:169
本文介绍了已禁用的表单字段未提交数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何方式(使用属性标志或类似的东西)启用禁用提交数据的表单字段吗?

Is there any way (with a attribute flag or something like that) to enable form fields that are disabled to submit data?

或者,如果这不可能,有没有办法阻止字段编辑css或任何其他属性而不是隐藏它们?

Or, if that's not possible, is there any way to block fields from editing with css or any other attribute than disabled without hiding them?

我现在的特殊情况是一个数据集的标识符应该以形式(不可编辑)显示 - 如果没有更好的解决方案,我想我会使用一个隐藏字段除了禁用一个保持实际值,禁用的一个显示它。

My special case at the moment is an identifier for a data-set that should be shown in the form (uneditable) - if there is no better solution i think i'll use a hidden field in addition to the disabled one to hold the actual value with the disabled one showing it.

推荐答案

检查只读属性 http:// www .w3schools.com / tags / att_input_readonly.asp

这篇关于已禁用的表单字段未提交数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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