document.upload.FileName.为空或不是对象
<html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><script...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript">
function check()
{
var strFileName=document.upload.FileName.value;
if(strFileName=="")
{
alert("请选择要上传的文件。");
document.upload.FileName.focus();
return false;
}
}
</script>
</head>
<body>
<form action="SaveToFile.asp" method="post" enctype="multipart/form-data" name=="upload" onSubmit="return check()">
<input name="FileName" type="FILE" size="40" id="FileName">
<input type="submit" name="Submit" Value="上传">
</form>
</body>
</html>
可以不用么?id不会用。刚学
o(∩_∩)o... 展开
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript">
function check()
{
var strFileName=document.upload.FileName.value;
if(strFileName=="")
{
alert("请选择要上传的文件。");
document.upload.FileName.focus();
return false;
}
}
</script>
</head>
<body>
<form action="SaveToFile.asp" method="post" enctype="multipart/form-data" name=="upload" onSubmit="return check()">
<input name="FileName" type="FILE" size="40" id="FileName">
<input type="submit" name="Submit" Value="上传">
</form>
</body>
</html>
可以不用么?id不会用。刚学
o(∩_∩)o... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询