PDA

View Full Version : what to do after passing data in forms


cybereaper
04-11-2004, 10:56 AM
I am becoming familiar with:
<form name="sending" method="POST" action="receive.asp"
target="_self"> //in Form1 (sendform.htm)
<input type="hidden" name="form_field" value="<% =request("form_field") %>">//in the receive.asp form
----------------------------------------------------------------
I want to stay with this method because the info I pass on I don't want seen.(not right away anyway.)
If I want a form where the first part is personal info, second purchase & cc info and the third a confirmation before emailing and posting my data to a database, am I right to assume the following:
'from the sendform.asp
<form name="sending" method="POST" action="receive.asp"
target="_self"> 'in Form1 (sendform.htm)
<input type=text name="name" />
'in the receive.asp form:
<input type="hidden" name="name" value="<% =request("name") %>">
<form name="sending2" method="POST" action="receive2.asp"
target="_self">
<input type=text name="creditcard" />
'in the receive2.asp form
<form name="sending3" method="POST" action="formprocessor.asp"
target="_self">'in Form3 (receive2.asp)
<BR> Please confirm the following:<BR>
<input type="text" name="name" value="<% =request("name") %>">
<input type="text" name="creditcard" value="<% =request("creditcard") %>">
'submit

Am I okay passing data from form1 to form2 and then to form3? Will the same data pass? and then will my WindowsNT CDONTS asp formprocessor handle the field names as it does with everything on one page? Also, will the input tpe "text" instead of hidden show the <% request (so I can do a verify before submittal)? And lastly, will the receive2.asp and receive.asp pages allow me to add an additional form to interface with, or how do I make that work?
Thanks to all

oracleguy
04-11-2004, 06:18 PM
Your headed in the right direction. You'll want the hidden fields that is the data from the previous page to be inside the form tags of the form that will be submitted to the next page, otherwise the they will not be sent.

You should be able to get the values from the hidden fields like you would get any other form field. A suggestion though, if you know the value is coming through a POST from the previous page, use Request.Form("") instead of just Request(""), if it is coming through a querystring use Request.QueryString(""). This is sort of a security issue. Because if you just generalize with the request object, someone could use your final processing page to say spam people by just supplying the final page with all the fields in a querystring. If you specify the fields are coming from a POST, then that cannot happen.

cybereaper
04-11-2004, 07:44 PM
In the request.form, do I need to specify form name?
eg.
<input type="hidden" name="form_field" value="<% =request.form("form_field") %>"> '-------------to:
<input type="hidden" name="form_field" value="<% =request.personalform("form_field") %>">'where personalform is the name specified in the <form> field
---------------------------------------------------------------------
and, as for the hidden fields:
Would I be wiser to make the input type="text" then identify the text color to match the background and simply make it invisible this way? I would want to have it beneath the next submit button, if that would also work?
------------------------------------------------------------------------
Lastly, in the ASP page that receives data, ie. receive.asp, can I set up that page to work like an html page with another user-input form on it, or do I want to have a receive.html page with asp script in it. I am not sure exactly how that works.

THANKS FOR ALL THE INFO!! That was awesome and fast, I really appreciate it!

oracleguy
04-11-2004, 10:08 PM
In the request.form, do I need to specify form name?
eg.
<input type="hidden" name="form_field" value="<% =request.form("form_field") %>"> '-------------to:
<input type="hidden" name="form_field" value="<% =request.personalform("form_field") %>">'where personalform is the name specified in the <form> field

No, only one form can but submitted at a time. You just need to do Request.Form()


and, as for the hidden fields:
Would I be wiser to make the input type="text" then identify the text color to match the background and simply make it invisible this way?

No.


I would want to have it beneath the next submit button, if that would also work?

You can put the hidden fields anywhere inside the <form> tag.


Lastly, in the ASP page that receives data, ie. receive.asp, can I set up that page to work like an html page with another user-input form on it, or do I want to have a receive.html page with asp script in it. I am not sure exactly how that works.

Not sure exactly what you mean. You can have an ASP script with an HTML page.

cybereaper
04-11-2004, 10:42 PM
I will continue to develop the remainder of the page this evening, spanning my form across several pages. I tried what you discussed, and it worked beautifully. Thanks for the really fast response.

PS- If and when you have a chance, I have an additional post here about calculating Form Totals.
http://www.codingforums.com/showthread.php?t=36668
It's the only part I had left to complete this form. Any knowledge is helpful, although you've already been excellent!!!!