复选框始终处于“启用"状态.
问题描述:
嗨!
Uploadify将文件发送到操作时,我需要知道是否选中了复选框,所以我做了:
When Uploadify send the file to the action, I need to know if the checbox is checked or not, so I did:
$('#uploaded').uploadify({
'uploader': '/uploadify.swf',
'cancelImg': '/cancel.png',
'script': '/Interaction/Upload',
'multi': true,
'auto': false,
'method': 'post',
'scriptData': {'Checkbox': $('#checkbox').val()},
});
但是我离开却获得了成功"的价值.不管是否检查.
But I aways get an "on" value. No matter if is checked or not.
有人可以帮忙吗?谢谢.
can anyone help? Tks.
更新:
我意识到页面加载时uploadify正在获取复选框.这意味着,如果我更改复选框(或任何其他类型的输入),则uploadify将获得初始值,在这种情况下为"checkbox = false"
I realized that uploadify is getting the checkbox when the page is loaded.This means that if I change the checkbox (or any other type of input) the uploadify will get the initial value, in this case, "checkbox = false".
如何使用uploadify发送表单?
How can I send a form with uploadify?
Tks.
答
尝试$('#checkbox').is(':checked')