主题:错误:对象不支持属性方法 windows.document.form
第一次打开时,页面一片空白,手动刷新一次后,才能正常显示并使用。不知道错误在哪里?请帮忙。谢谢。
部分代码如下:
...
<TITLE>上传特写图片</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<SCRIPT LANGUAGE="vbscript">
function addfile()
dim str
str="<table>"
if not IsNumeric (window.document.form.filenum.value) then window.document.form.filenum.value =1
for i=1 to window.document.form.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='file"&i&"' size='20' class='tx2'>(要写图片格式)</td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</SCRIPT>
...
<FORM METHOD="post" NAME="form" ENCTYPE="multipart/form-data">
<TABLE bordercolordark="#9CC7EF" bordercolorlight="#145AA0" cellspacing="0" cellpadding="1" align="center" style="font-size:14px;BORDER-COLLAPSE: collapse">
<TR>
<TD>
<TABLE WIDTH="720" BORDER="1" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#6600FF" style="font-size:14px;BORDER-COLLAPSE: collapse">
<tr>
<td colspan="2" align="center" HEIGHT="30" style="color:#F00;font-size:16px">产品款号:<%=style_no%></td>
</tr>
<TR>
<TD HEIGHT="27" COLSPAN="2">上传<INPUT NAME="filenum" CLASS="tx2" VALUE="1" SIZE="4">个文件
<INPUT TYPE="button" NAME="Button" CLASS="bt" onClick="addfile" VALUE="设 定">
</TD>
</TR>
<TR>
<TD> <DIV ID="uptd"> </DIV></TD>
</TR>
<TR>
<TD HEIGHT="30" COLSPAN="2" ALIGN="middle">
<INPUT TYPE="submit" NAME="Button" CLASS="bt" VALUE="上 传">
<INPUT TYPE="reset" NAME="Button" CLASS="bt" VALUE="重 置">
<input type="button" name="Submit4" CLASS="bt" value="关 闭" onClick="Javascript:window.close()">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
...
部分代码如下:
...
<TITLE>上传特写图片</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<SCRIPT LANGUAGE="vbscript">
function addfile()
dim str
str="<table>"
if not IsNumeric (window.document.form.filenum.value) then window.document.form.filenum.value =1
for i=1 to window.document.form.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='file"&i&"' size='20' class='tx2'>(要写图片格式)</td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</SCRIPT>
...
<FORM METHOD="post" NAME="form" ENCTYPE="multipart/form-data">
<TABLE bordercolordark="#9CC7EF" bordercolorlight="#145AA0" cellspacing="0" cellpadding="1" align="center" style="font-size:14px;BORDER-COLLAPSE: collapse">
<TR>
<TD>
<TABLE WIDTH="720" BORDER="1" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#6600FF" style="font-size:14px;BORDER-COLLAPSE: collapse">
<tr>
<td colspan="2" align="center" HEIGHT="30" style="color:#F00;font-size:16px">产品款号:<%=style_no%></td>
</tr>
<TR>
<TD HEIGHT="27" COLSPAN="2">上传<INPUT NAME="filenum" CLASS="tx2" VALUE="1" SIZE="4">个文件
<INPUT TYPE="button" NAME="Button" CLASS="bt" onClick="addfile" VALUE="设 定">
</TD>
</TR>
<TR>
<TD> <DIV ID="uptd"> </DIV></TD>
</TR>
<TR>
<TD HEIGHT="30" COLSPAN="2" ALIGN="middle">
<INPUT TYPE="submit" NAME="Button" CLASS="bt" VALUE="上 传">
<INPUT TYPE="reset" NAME="Button" CLASS="bt" VALUE="重 置">
<input type="button" name="Submit4" CLASS="bt" value="关 闭" onClick="Javascript:window.close()">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
...