日期:2014-05-16  浏览次数:20841 次

大家帮帮看看
下面的代码在IE上运行时,不能跳转到try22.asp并且也不能判断
<script language="vbscript">
sub checkdata()
if  Not isnumeric(form.num1.value) Or len(form.num1.value)<>9   then
alert"1字符串不是9位或不是数字字符串!"
form.num1.focus
elseif len(form.num2.value)<>9 Or Not isnumeric(form.num2.value) then
 msgbox"2字符串不是9位或不是数字字符串!"
elseif form.name.value="" then
msgbox"姓名不能为空!"
form.name.focus
elseif form.score1.value="" then
msgbox"成绩score1不能为空!"
form.score1.focus
elseif form.score1.value >100 or form.score1.value <0 then
msgbox"输入成绩应在0-100之间!"
form.score1.focus
elseif form.score2.value="" then
msgbox"成绩score2不能为空!"
form.score2.focus
elseif form.score2.value>100 or form.score2.value<0 then
msgbox"输入成绩应在0-100之间!"
form.score2.focus
else
form.submit
end if
end sub
</script>

<div align = center>
添加记录
<table>
<form name="form" method = post action ="try22.asp">
    <tr>
        <td>查询学号:</td>
<td><input type = "text" name = "num1"></td>
    </tr>

    <tr>
        <td>学号:</td>
<td><input type = "text" name = "num2"></td>
    </tr>
    <tr>
<td>姓名:</td>
<td><input type = "text" name = "name"></td>
    </tr>
    <tr>
        <td>成绩1:</td>
<td><input type = "text" name = "score1"></td>
    </tr>
    <tr>
<td>成绩2:</td>
<td><input type = "text" name = "score2"></td>
    </tr>
    <tr>
<td><input type = "button" value = "确定" onclick="checkdata"></td>
<td><input type = "reset" value = "重新填写"></td>
    </tr>
</form>
</table>
ASP问题

------解决方案--------------------
楼主确认用的IE?我这里IE8测试没有问题

你的是客户端代码,用vbs写的,只能在ie运行