tongj
注册会员

初级会员
UID 62888
精华
0
积分 104
帖子 67
金钱 104 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2005-1-2
状态 离线
|
[推荐阅读] hoyong网店系统1.0发布拉
用JAVASCRIPT添加INPUT就行了的
我又自己写了一个程序,添加INPUT可以实现.但删除的时候不能完全对应
<?php <HTML> <HEAD> <script> var file_to=0; function add_inp(){ newInp = document.createElement("input"); newInp.setAttribute("id","file_"+file_to); newInp.setAttribute("type","file"); newInp.setAttribute("name","upfile[]"); div1.appendChild(newInp); newInp = document.createElement("<input onclick=del_inp("+file_to+")>"); newInp.setAttribute("id","file_del_"+file_to); newInp.setAttribute("type","button"); newInp.setAttribute("value","删除"); div1.appendChild(newInp); newInp.setAttribute("id","file_br_"+file_to); newInp = document.createElement("br"); div1.appendChild(newInp); file_to++; } function del_inp(file_id){ file_id+=2; file_to-=3; div1.removeChild(div1.childNodes[file_id]); file_id--; div1.removeChild(div1.childNodes[file_id]); file_id--; div1.removeChild(div1.childNodes[file_id]); } </script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></HEAD> <BODY> <FORM METHOD="post" ENCTYPE="multipart/form-data" name=f1> <div id=div1> </div> <INPUT TYPE="button" VALUE="增加上传" onclick=add_inp()> <INPUT TYPE="button" VALUE="减少上传" onclick=del_inp()><br> <INPUT TYPE="submit" VALUE="提 交" NAME="Submit"> </FORM> </BODY> ?>
|  爱资讯92jijin.com |
|