我需要在文件上传时禁用提交按钮。
<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");
}
});发布于 2014-04-09 21:29:48
$('#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")
}
});https://stackoverflow.com/questions/22972725
复制相似问题