J
John Davis
<html>
<body>
<Form action="calc.asp" method="post" name="calc">
<P>NUM1: <input type="text" name="num1">
<P>NUM2: <input type="text" name="num2">
<P>RESULT: <input type="text" name="result">
<P><input type="submit">
</Form>
I want to write an ASP page to accept 2 numbers, and return the sum on the
same page. Can we do it in pure ASP without JavaScript?? It sounds an easy
problem, and I did that in ASP.NET and JavaScript, but failed in pure ASP
3.0. Here's the attempts, but definitely not what I want because I want the
result back to the text field.
<%
Dim num1, num2, result
num1 = CInt(Request.Form("num1"))
num2 = CInt(Request.Form("num2"))
result = num1 + num2
Response.Write("<P>Num1 = " & num1)
Response.Write("<P>Num2 = " & num2)
Response.Write("<P>Num3 = " & result)
%>
</body>
</html>
<body>
<Form action="calc.asp" method="post" name="calc">
<P>NUM1: <input type="text" name="num1">
<P>NUM2: <input type="text" name="num2">
<P>RESULT: <input type="text" name="result">
<P><input type="submit">
</Form>
I want to write an ASP page to accept 2 numbers, and return the sum on the
same page. Can we do it in pure ASP without JavaScript?? It sounds an easy
problem, and I did that in ASP.NET and JavaScript, but failed in pure ASP
3.0. Here's the attempts, but definitely not what I want because I want the
result back to the text field.
<%
Dim num1, num2, result
num1 = CInt(Request.Form("num1"))
num2 = CInt(Request.Form("num2"))
result = num1 + num2
Response.Write("<P>Num1 = " & num1)
Response.Write("<P>Num2 = " & num2)
Response.Write("<P>Num3 = " & result)
%>
</body>
</html>