#12006/6/9 21:54:05
<html>
<head>
<script language="vbscript">
function addfile()
dim str
str="<table>"
if not IsNumeric (window.form1.filenum.value) then window.form1.filenum.value =1
if window.form1.filenum.value>10 then window.form1.filenum.value =1
if window.form1.filenum.value<0 then window.form1.filenum.value =1
for i=1 to window.form1.filenum.value
str=str&"<tr><td valign='middle'>文件"&i&":</td><td><input type='file' name='file"&i&"' class='tx1' value size='20'> 保存为<input type='text' name='image"&i&"' size='10' class='tx2'></td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</script>
<title>图片上传</title>
</head>
<CENTER>
<body bgcolor="#ffffff" class="p9" onload="addfile()">
<form method="post" name="form1" action="upfile.asp" enctype="multipart/form-data">
<table width="380" border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" style="BORDER-COLLAPSE: collapse">
<tr>
<td height="25" colspan="2" align="center">上传 <input name="filenum" class="tx2" value="1" size="2">个文件 <input type="button" name="Button" class="bt" onclick="addfile" value="设 定"> <input type="submit" name="Button" class="bt" value="上 传"> <input type="reset" name="Button" class="bt" value="重 置"></td>
</tr>
<tr>
<td><div id="uptd"></div></td>
</tr>
</table>
</form>
</body>
</CENTER>
</html>
请问当用户提交时,要怎验证表单是否为空啊!
另外我上传成功后,怎么把上传后的地址又返回到<input type='text' name='image"&i&"' size='10' class='tx2'>里啊,恳请各位高手指点一下!