Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Get back form values


Message #1 by "Nick" <ektorjr@h...> on Fri, 27 Dec 2002 11:13:14
Hello, i´m sorry if somebody has already answered this before.

Whenever my user posts a form i want to send back the form´s values when i 
send him back to the form page because of an error i found in the database.

Is it possible to show the values he entered as default values in the same 
fields? I dont want to make him input the fileds again and again because 
of an error i found in the database.

Thanks a lot

Nick
Message #2 by Nikos <pappas@c...> on Fri, 27 Dec 2002 14:47:26 +0200
Hi Nick
Maybe others here will give you better solutions but
I thing something like this will do the job.

<%
Session("UserID") = "sometext"
Session("sessYear") = "2001"
%>

I don't know how this will affect performance
using many session variables but
I hope it will help.

Best regards and

Happy new year everybody!

Nikos

At 01:13 ìì 27/12/2002, you wrote:
>Hello, i´m sorry if somebody has already answered this before.
>
>Whenever my user posts a form i want to send back the form´s values when i
>send him back to the form page because of an error i found in the database.
>
>Is it possible to show the values he entered as default values in the same
>fields? I dont want to make him input the fileds again and again because
>of an error i found in the database.
>
>Thanks a lot
>
>Nick

Message #3 by Greg Griffiths <greg2@s...> on Fri, 27 Dec 2002 17:22:02 +0000
Each HTML field has a VALUE attribute or similar that you can use.

At 11:13 27/12/02 +0000, you wrote:
>Hello, i=B4m sorry if somebody has already answered this before.
>
>Whenever my user posts a form i want to send back the form=B4s values when
 i
>send him back to the form page because of an error i found in the database.
>
>Is it possible to show the values he entered as default values in the same
>fields? I dont want to make him input the fileds again and again because
>of an error i found in the database.
>
>Thanks a lot
>
>Nick



Message #4 by "Nick" <ektorjr@h...> on Fri, 27 Dec 2002 21:50:35
> Each HTML field has a VALUE attribute or similar that you can use.

Yes but, how do I get them back to the original form page? Are Session 
variables my only option?

Nick
Message #5 by "John Eix" <jeix@s...> on Fri, 27 Dec 2002 20:55:14 -0500
To do what you want to do I first save the record in the database so I
have it and then give the user the option of changing information by
reading the information out of the database and using the following to
populate the form

        <TD><SELECT NAME="STUDENTNAME" SIZE="1">
		<OPTION SELECTED> <% Response.Write strSTUDENTNAME %>

Where strSTUDENTNAME was the student's name saved in the database. I use
a query to select and the record and then a query to update it if
anything changes.

-----Original Message-----
From: Nick [mailto:ektorjr@h...] 
Sent: December 27, 2002 21:51
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Get back form values


> Each HTML field has a VALUE attribute or similar that you can use.

Yes but, how do I get them back to the original form page? Are Session 
variables my only option?

Nick


Message #6 by "Nick" <ektorjr@h...> on Sat, 28 Dec 2002 10:04:30
The reason i send the user back to the form page, is that i dont insert 
any record in the database, because (let's say) i found another record 
with the same username (a common scenario). 

I want to send him back to the form page, with the appropriate error 
message, but keep the values he entered in the form's fields - not have 
him type again and again......

Is there a solution?

Nick

> To do what you want to do I first save the record in the database so I
have it and then give the user the option of changing information by
reading the information out of the database and using the following to
populate the form
Message #7 by "TomMallard" <mallard@s...> on Sat, 28 Dec 2002 07:15:52 -0800
It's pretty easy to add your values to a query string and have the client
page insert them with the onload() event.

tom mallard
seattle

-----Original Message-----
From: Nick [mailto:ektorjr@h...]
Sent: Saturday, December 28, 2002 10:05 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Get back form values


The reason i send the user back to the form page, is that i dont insert
any record in the database, because (let's say) i found another record
with the same username (a common scenario).

I want to send him back to the form page, with the appropriate error
message, but keep the values he entered in the form's fields - not have
him type again and again......

Is there a solution?

Nick

> To do what you want to do I first save the record in the database so I
have it and then give the user the option of changing information by
reading the information out of the database and using the following to
populate the form



  Return to Index