ASP中不能结束和类型错误问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 00:11:06
<form action=calculator1.asp method=post>
操作数1: <input type=text name=num1><br>
操作数2: <input type=text name=num2><br>
<p>
选择你要进行的操作<br>
<input type=radio name=operation value="加" checked>加<br>
<input type=radio name=operation value="减">减<br>
<input type=radio name=operation value="乘">乘<br>
<input type=radio name=operation value="除">除<br>
<input type=submit><input type=reset>
</form>
<hr>
<%
dim n1,n2,op
if request.form.count=0 then
response.end
end if
n1=request.form("num1")
n2=request.form("num2")
op=request.form("operation")
if op="加" then
response.write n1
response.write "+"
response.write n2
response.write "="
response.write

加入一个判断语句用JAVASCRIPT判断也可以 需要把你的FORM给个NAME在这里我给个NAME1
<SCRIPT LANUAGE=JAVASCRIPT>
FUNCTION CheckValue()
{
if (document.form1.num1.value=="")
{
alert('请输入数值');
return false;
}
if (document.form1.num2.value=="")
{
alert('请输入数值');
return false;
}
return true;
}
</SCRIPT>