通过客户端验证上传图片文件大小的ASP源码(4)
var preview=GetNamedItem(divItem,"preview");
div.style.overflow="hidden";
preview.style.position="static";
}
</SCRIPT>
<BODY>
<DIV>
<BUTTON ID="btn_add">添加一个需要上传的图片</BUTTON>
<BUTTON ID="btn_submit">提交所有内容</BUTTON>
</DIV>
<DIV>
<FORM ID="form_submit" ACTION="e.g.jscript.action.asp" METHOD="POST" ENCTYPE="multipart/form-data" ONSUBMIT="Check_From()">
<INPUT ID="input_submit" TYPE="submit" STYLE="display:none">
</FORM>
</DIV>
<FORM ID="form_template" STYLE="display:none;">
<DIV CLASS="form_item">
<DIV>
要上传图片(<SPAN id="filesize"></SPAN>)的路径: <BUTTON CLASS="delete" ONCLICK="Delete_FormItem()">删除</BUTTON>
</DIV>
<DIV STYLE="border:1px orange solid;width:200px;height:50px;overflow:hidden;" ONMOUSEOVER="OnPreviewMouseOver(this)" ONMOUSEOUT="OnPreviewMouseOut(this)" ONCLICK="OnPreviewClick(this)">
<INPUT TYPE="hidden" NAME="width" VALUE="0">
<INPUT TYPE="hidden" NAME="height" VALUE="0">
<IMG ID="preview" STYLE="position:static" ONLOAD="OnPreviewLoad(true)" ONERROR="OnPreviewLoad(false)">
</DIV>
<DIV>
<INPUT TYPE="file" NAME="file" CLASS="file" ONCHANGE="Show_Preview()">
</DIV>
<DIV>
相关的描述:
</DIV>
<DIV>
<TEXTAREA NAME="info" CLASS="info" ROWS="4"></TEXTAREA>
</DIV>
</DIV>
</FORM>
</BODY>
<SCRIPT>
Add_FormItem();
function btn_add.onclick()
{
Add_FormItem();
}
function btn_submit.onclick()
{
if(Check_Form())
form_submit.submit();
}
</SCRIPT>
</HTML>
内容版权声明:除非注明,否则皆为本站原创文章。