1个回答
2014-02-23
展开全部
.... 愁了。 用ASP做计算机.不得刷新页面嘛. 不如用JS实现,不刷新直接得出结果.===表单页====================================<form action="yx.asp" method="post">
<input type="text" name="fname"> <input type="text" name="ename"> <select name="ys">
<option value="*">乘法</option>
<option value="/">除法</option>
<option value="+">加法</option>
<option value="-">减法</option>
</select>
<input type="submit" value="运算" />
</form>===处理页====================================<% n1=request.form("fname") n2=request.form("ename") ys=request.form("ys")if ys="+" then ot = n1+n2if ys="-" then ot = n1-n2if ys="*" then ot = n1*n2if ys="/" then if n1="" or n1=0 then ot="被除数不能为0" else ot = n1/n2 end ifend ifresponse.write(ot)%>
<input type="text" name="fname"> <input type="text" name="ename"> <select name="ys">
<option value="*">乘法</option>
<option value="/">除法</option>
<option value="+">加法</option>
<option value="-">减法</option>
</select>
<input type="submit" value="运算" />
</form>===处理页====================================<% n1=request.form("fname") n2=request.form("ename") ys=request.form("ys")if ys="+" then ot = n1+n2if ys="-" then ot = n1-n2if ys="*" then ot = n1*n2if ys="/" then if n1="" or n1=0 then ot="被除数不能为0" else ot = n1/n2 end ifend ifresponse.write(ot)%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询