我有一个jQuery选择选项,我必须从任何更改中冻结(禁用)。但是当我做的时候
$(this).attr('disable', true);
选择冻结但它以null发送的值,因为它中没有选择任何内容。如何冻结并仍然发送所选值?
答案 0 :(得分:0)
您无法将disabled
输入字段传递给帖子。使用readonly
或hidden
字段或将此select
样式设为display:none
。
最好使用readonly
答案 1 :(得分:0)
您可以在提交之前再次启用该元素。
$('#myForm').submit(function() {
$(this).find(':input:disabled') // Find disabled form elements within the form
.prop('disabled', false); // Enable elements
});