在頁面的客戶端,實現(xiàn)一次上傳多個文件總是非常麻煩,那個討厭的file按鈕總是改不了,這也許是個比較好的辦法,給大家參考。刪除 刪除 <form name="form" method="post" enctype="multipart/form-data" target="editpost" ID="Form1"><select class="TBGen" name="SelectFile" style="width:200"></select><button onclick="DelFiletoSelect()">刪除</button><span id="AffixFile"> <span><input style="width:10" name="affixs" type="file" onpropertychange="AddFiletoSelect(this)"></span></span></form><SCRIPT LANGUAGE="JavaScript"> function AddFiletoSelect(aoFile){ if ((aoFile==null)||(aoFile.value=="")) return; var loOpts = form.SelectFile.options; loOpts[loOpts.length] = new Option(aoFile.value,aoFile.uniqueID); aoFile.parentElement.style.display = "none"; var loObj = document.createElement("span"); loObj.innerHTML = '<input style="width:10" name="affixs" type="file" onpropertychange="AddFiletoSelect(this)">'; AffixFile.insertBefore(loObj); } function DelFiletoSelect(){ loEL = document.all(form.SelectFile.value); if (loEL!=null){ loEL = loEL.parentElement; AffixFile.removeChild(loEL); } var loOpts = form.SelectFile.options; if(loOpts!=null&&loOpts.length>0){ loSel = loOpts[form.SelectFile.selectedIndex] loOpts.removeChild(loSel); } }</SCRIPT>
<form name="form" method="post" enctype="multipart/form-data" target="editpost" ID="Form1"><select class="TBGen" name="SelectFile" style="width:200"></select><button onclick="DelFiletoSelect()">刪除</button><span id="AffixFile"> <span><input style="width:10" name="affixs" type="file" onpropertychange="AddFiletoSelect(this)"></span></span></form><SCRIPT LANGUAGE="JavaScript"> function AddFiletoSelect(aoFile){ if ((aoFile==null)||(aoFile.value=="")) return; var loOpts = form.SelectFile.options; loOpts[loOpts.length] = new Option(aoFile.value,aoFile.uniqueID); aoFile.parentElement.style.display = "none"; var loObj = document.createElement("span"); loObj.innerHTML = '<input style="width:10" name="affixs" type="file" onpropertychange="AddFiletoSelect(this)">'; AffixFile.insertBefore(loObj); } function DelFiletoSelect(){ loEL = document.all(form.SelectFile.value); if (loEL!=null){ loEL = loEL.parentElement; AffixFile.removeChild(loEL); } var loOpts = form.SelectFile.options; if(loOpts!=null&&loOpts.length>0){ loSel = loOpts[form.SelectFile.selectedIndex] loOpts.removeChild(loSel); } }</SCRIPT>
溫馨提示:喜歡本站的話,請收藏一下本站!
本站發(fā)布的Win7純凈版系統(tǒng)、Win10純凈版和XP純凈版系統(tǒng)僅為個人學(xué)習(xí)測試使用,請在下載后24小時內(nèi)刪除,不得用于任何商業(yè)用途,否則后果自負,請支持購買微軟正版軟件!
本站所有資源全部來自于網(wǎng)絡(luò)資源,如侵犯到您的權(quán)益,請及時通知我們(),我們會及時處理.
Copyright © 2018-2020 蘿卜系統(tǒng)下載站 手機站 關(guān)于本站