Print Page | Close Window

Adding two numbers using textfield

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7911
Printed Date: 30 March 2026 at 12:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Adding two numbers using textfield
Posted By: smahadevan
Subject: Adding two numbers using textfield
Date Posted: 06 December 2003 at 11:53pm
I really need help in ASP. Lets say i have a form and i have two textfield in the form. The data type will be number and i need to add the numbers from the textfields. Then after submission it should show me the results in the next page. I would like to know how the total of the two could be shown in another page through database. Please give me an example such as adding two number , insert into database(access) and autocalculate the total and to be viewed in another page.



Replies:
Posted By: michael
Date Posted: 07 December 2003 at 7:58am
If you have two numbers in a text filed you can just add them on the following page like
mynumber = CInt(Request.Form("field1") + CInt(Request.Form("field2")
depending on the value (comma value) you can try CDbl instead of CInt, then you just put it in the database or whatever you want to do with it.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net