代码改变世界

关于form提交文件之后value清空

2015-04-08 14:26  厘澄  阅读(1279)  评论(0编辑  收藏  举报

ie 改变value 还会触发onchange

解决方案:

 1 s._file.on('change',function(){
 2 //如果文件名无效则不做处理
 3 //if(s._file.val()=="" || typeof(s._file.val())==undefined) return;    //刘少华去掉
 4 s._form.submit();    
 5 s.uploadingFlag = true;
 6 setTimeout(function () {
 7 s._file.val('');
 8 },4000);
 9 
10 //开始做超时计时
11 if (s._file.val() != '') {
12 s._timeoutInstance = setTimeout(function(){
13 
14 s.stopUploading();
15 $s.trigger("hyq/imguploader/timeout");
16 s.uploadingFlag = false;
17 }, s._timeout);
18 $s.trigger(s._E.uploading);
19 }
20 });

 

还要动态删除form标签