清除上傳文件input標簽中type="file"的value值


1.清空<input type="file" id="xfile" name="xfile">的值:

//刪除照片
function DelPic(){
document.formform.pFlag.value=2;//后台是否處理圖片0否1是2刪除
document.getElementById("PreviewImg").innerText="預覽區";
document.getElementById("MsgList").innerText="";
var nfile = jQuery("#xfile");//qingkon
nfile.after(nfile.clone().val(""));
nfile.remove();
}
2.對上傳文件的格式校驗:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM