主题:请指教
<script language="vbscript">
sub myexcel()
ExeclFile=document.form1.myfile.value
if ExeclFile="" then
msgbox("文件名不能为空")
location.href="aa.asp"
exit sub
end if
end sub
</script>
aa.asp
<form action="ab.asp" method="post" name="form1" onsubmit="myexcel()">
<input name="myfile" type="file"><br>
<input name="" type="submit" value="提交">
</form>
myfile为空时提交,为什么myexcel()不起作用呢,而继续转向ab.asp
sub myexcel()
ExeclFile=document.form1.myfile.value
if ExeclFile="" then
msgbox("文件名不能为空")
location.href="aa.asp"
exit sub
end if
end sub
</script>
aa.asp
<form action="ab.asp" method="post" name="form1" onsubmit="myexcel()">
<input name="myfile" type="file"><br>
<input name="" type="submit" value="提交">
</form>
myfile为空时提交,为什么myexcel()不起作用呢,而继续转向ab.asp