Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2005, 05:39 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jerrin
Default Help

Hi everyone,

Can anyone help me out with this problem? I have an asp page with 5 textbox controls. the user is allowed to enter values in 4 of them and when he clicks on the submit button the sum of the 4 values should be displayed in the fifth box. now.. the problem... i am able to do this by writing a simple vbscript function. so far so good. now in addition to this i want to display the corresponding grade for the sum, which i retreive from the database. so as to retreive the info from the db, i need to have <form> tags with method as post or get. but then, the script does not work. when i works without the script the page self references and the values entered are not displayed. am i missing something here or.... i am in a fix. do enlighten me. thank u.

jerrin

 
Old May 12th, 2005, 05:55 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Jerrin,

When you submit the form, the page is rebuilt & any values entered in the text boxes are lost.

You can populate the boxes again by writing the value submitted in the form into their value attributes, e.g. for a post...
Code:
<input type="text" name="myTextBox" value="<%=Server.HTMLEncode(Request.Form("myTextBox"))%>" />
 
Old May 12th, 2005, 04:17 PM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jerrin
Default

Hi Chris,

Thank you for the answer, but I had already tried this out. What happens is.. I am able to populate the controls as you mentioned but the reset button would not function, if the user wished to change/reset the values. Is it possible to view the result on another page and have it displayed on the same page in a different frame.. i hope i have made myself clear. I am not able to get a solution for this. The problem is i want to execute a script and communicate with the database on the same page as i mentioned before.

jerrin










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.