Tranfering variable from a asp form page to a ACTION page
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > Tranfering variable from a asp form page to a ACTION page




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Tranfering variable from a asp form page to a ACTION page  
Jack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

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 wa
y
to resolve this. Any help is appreciated.
Thanks.






[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Ray Costanzo [MVP]


Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

> 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


"Jack" <Jack@discussions.microsoft.com> wrote in message
news:3A15610B-91A1-4840-A2E8-29A83D9EF32F@microsoft.com...
> 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.
>







[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Evertjan.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

Ray Costanzo [MVP] wrote on 22 dec 2004 in
microsoft.public.inetserver.asp.general:
 
>
> What is it then?
>

an error ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)





[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Jack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

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 Costanzo [MVP]" wrote:
 
>
> What is it then?
>
> Ray at work
>
>
> "Jack" <Jack@discussions.microsoft.com> wrote in message
> news:3A15610B-91A1-4840-A2E8-29A83D9EF32F@microsoft.com... 
> used 
> NetOutlay 
> way 
>
>
>





[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Ray Costanzo [MVP]


Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

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

Ray at work

"Jack" <Jack@discussions.microsoft.com> wrote in message
news:D7663342-3DC6-4E98-AA85-AFBFE8035E70@microsoft.com...[vbcol=seagreen]
> 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 Costanzo [MVP]" wrote:
> 
field.[vbcol=seagreen] 
database.[vbcol=seagreen] 
page to[vbcol=seagreen] 
field.[vbcol=seagreen] 
whether[vbcol=seagreen] 
the[vbcol=seagreen] 
better[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

Jack wrote:
> 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 Costanzo [MVP] wrote:
> 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

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.







[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Jack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

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.

"Ray Costanzo [MVP]" wrote:

> Okay, but in what type of element does it exist?  <input, <legend, <span,
> <textarea, etc.?
>
> Ray at work
>
> "Jack" <Jack@discussions.microsoft.com> wrote in message
> news:D7663342-3DC6-4E98-AA85-AFBFE8035E70@microsoft.com... 
> field. 
> database. 
> page to 
> field. 
> whether 
> the 
> better 
>
>
>





[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Jack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

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?

"Bob Barrows [MVP]" wrote:

> Jack wrote: 
> Ray Costanzo [MVP] wrote: 
>
> IOW, the value has to be stored in an html element whose name attribute ha
s
> been set in order for it to be passed to the ACTION page. You can put in i
n
> an INPUT element of type "hidden"
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>





[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

Jack wrote:
> 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


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"







[ Post a follow-up to this message ]



    Re: Tranfering variable from a asp form page to a ACTION page  
Scott McNair


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-23-04 10:59 PM

"examnotes" <Jack@discussions.microsoft.com> wrote in
news:3A15610B-91A1-4840-A2E8-29A83D9EF32F@microsoft.com:

> 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")





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:08 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register