<html> <head> <script type="text/javascript"> function checkUpload() { for(var i=0;i<document.files.filename.length;i++){ if(document.files.filename[i].value=="未选择文件"){ alert("请检查要上传的文件是否全部添加!"); return false; } } } </script> </head> <body> <form name="files" enctype="multipart/form-data" method="POST" action="http://www.baidu.com" onsubmit="return checkUpload()"> <div class="file-btn-box"> <input type="button" class="add-btn" value="添加文件" onclick="addinput()"> <input type="submit" class="submit-btn" id="upload" value="上传" ><br> </div> <table id="file"> <input type="text" name="filename" > <input type="text" name="filename" > </table> </form> </body> </html>
时间: 2024-09-30 04:09:58