Tranfering variable from a asp form page to a ACTION page

J

Jack

Hi,
I got a asp form page where the POST ACTION = confirmation.asp page is used
to save the values collected from text boxes from the form in a database.
For example txtTotalOutlay field is being used in confirmation.asp page to
update a database field.

However, there is a field in the form which is calculated field e.g.
NetOutlay = .90 * txtTotalOutlay. This NetOutlay is thus not a text field.
However, in the confirmation field I need to bring the contents of NetOutlay
and store it in the same table as the other field. I am wondering whether
putting the value of the NetOutlay in Session variable and using in the
confirmation.asp field would be the right approach or there be any better way
to resolve this. Any help is appreciated.
Thanks.
 
R

Ray Costanzo [MVP]

However, there is a field in the form which is calculated field e.g.
NetOutlay = .90 * txtTotalOutlay. This NetOutlay is thus not a text field.

What is it then?

Ray at work
 
J

Jack

The value of netoutlay field is not captured from the user. Rather it is a
calulated field by using the value from txtTotalOutlay. Hope I was clear
enough here. Thanks.
 
R

Ray Costanzo [MVP]

Okay, but in what type of element does it exist? <input, <legend, <span,
<textarea, etc.?

Ray at work
 
B

Bob Barrows [MVP]

Jack said:
The value of netoutlay field is not captured from the user. Rather it
is a calulated field by using the value from txtTotalOutlay. Hope I
was clear enough here. Thanks.
Ray said:
Okay, but in what type of element does it exist? <input, <legend,
<span, <textarea, etc.?

IOW, the value has to be stored in an html element whose name attribute has
been set in order for it to be passed to the ACTION page. You can put in in
an INPUT element of type "hidden"

Bob Barrows
 
J

Jack

Actually, in the main form there are about eitht text fields where the user
inputs values. Based on the values, some calculated fields are displayed on
the form. Hence
NetTotalOutlay can be termed as a variable that stores values by the use of
text field input value. The variable is used to display the NetToalOutlay.
Thus, it is neither of the above.
Thus the above variable need to be used in the confirmation.asp field to
update
one of the table fields.
The Hope this helps. Thanks Ray.
 
J

Jack

Thanks for the help Bob. Here is a quick question. Does it make any sense if
I try to put the variable(Netoutlay) in a session vairable and try to use it
in the confirmation.asp form? Conceptually, does it make any sense? Thanks
PS: Do you have any link for hidden INPUT element example?
 
B

Bob Barrows [MVP]

Jack said:
Thanks for the help Bob. Here is a quick question. Does it make any
sense if I try to put the variable(Netoutlay) in a session vairable
and try to use it in the confirmation.asp form?

If it's being calculated server-side, then there is no reason not to use a
session variable
Conceptually, does it
make any sense? Thanks PS: Do you have any link for hidden INPUT
element example?

Do a search at msdn.microsoft.com/library for "input element". All the
documentation can be found there.

Bob Barrows
 
S

Scott McNair

Any help is appreciated.

On the client:

<%MySecretValue = 12345%>

<form method=post action="xxx.asp">
<input type=text name=UserName><br>
<input type=text name=PhoneNo><br>
<input type=hidden name=SecretValue value='<%=MySecretValue%>'>
</form>

-------------------

On the server:

UserName = Request.Form("UserName")
PhoneNo = Request.Form("PhoneNo")
SecretValue = Request.Form("SecretValue")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top