我需要在文件上传时禁用提交按钮..
<button type="submit" id="submit_button" class="btn btn-default">Odeslat</button>
JS:
$('#file_upload').uploadify({
'swf' : 'css/uploadify.swf',
'uploader' : 'uploadify.php?galerie=<?php echo $n; ?>',
'onUploadProgress' : function(file) {
$('#submit_button').prop('disabled', true);
}
});
但这不起作用..
修改
正确的解决方案:
$('#file_upload').uploadify({
'swf': 'css/uploadify.swf',
'uploader' : 'uploadify.php?galerie=<?php echo $n; ?>',
'onUploadProgress' : function(file) {
$('#submit_button').attr('disabled', 'disabled');
},
'onUploadComplete': function(file) {
$('#submit_button').removeAttr("disabled");
}
});
答案 0 :(得分:-1)
$('#file_upload').uploadify({
'swf' : 'css/uploadify.swf',
'uploader' : 'uploadify.php?galerie=<?php echo $n; ?>',
'onUploadProgress' : function(file) {
$('#submit_button').attr('disabled', 'disabled');
},
'onComplete': function(event, queueID, fileObj, response, data) {
$('#submit_button').removeAttr("disabled")
}
});