<script type="text/javascript">
function imgPreView(imgSrc)
{
var imgSrc='file:///'+imgSrc.replace(/\\/g,"/");
imgSrc=imgSrc.toLowerCase();
if(imgSrc)
{
var imgInDoc=window.document.getElementById("imgInDocument");
imgInDoc.src = imgSrc;
imgInDoc.style.display="";
imgInDoc.height=200;
}
}
function imgTextSignCheck()
{
if(window.document.getElementById("FileUpload1").value==""&&window.document.getElementById("FileUpload2").value==""&&window.document.getElementById("FileUpload3").value==""&&window.document.getElementById("FileUpload4").value==""&&window.document.getElementById("FileUpload5").value==""&&window.document.getElementById("FileUpload6").value=="")
{
window.alert("您没有添加图片!");
return false;
}
}
function document.onkeypress()
{
if(event.keyCode==13)
{
return false;
}
}
</script>【JavaScript】验证图片
最新推荐文章于 2023-03-02 23:43:22 发布
本文详细介绍了如何使用JavaScript实现图片预览功能,并通过验证确保用户上传了至少一张图片,确保网页应用的交互性和安全性。
1998

被折叠的 条评论
为什么被折叠?



