Forums
This topic is locked
Advanced Form Help
Posted 04 Aug 2002 02:10:17
1
has voted
04 Aug 2002 02:10:17 Dave Thomas posted:
Rather than have a customer trawl through some huge form, how do you create the form to get its information over say 4 pages.Example
page 1 : grabs name details
page 2 : grabs contact details
page 3 : grabs order details
page 4 ; grabs extra option details
then page 5 sticks it all together and sends it to me using CDONTS, or would i need to CGI it, if so this is not a problem, just need to know how to capture all the data properly and make sure it stays intact over multiple pages.
Any pointers would be great <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
"Get the kettle on, time for a brew"
Replies
Replied 04 Aug 2002 06:57:22
04 Aug 2002 06:57:22 Dave Clarke replied:
could you set session variables based on the form inputs from pages 1-4, then stick them all in page 5 and send yourself the email from that?
Replied 04 Aug 2002 12:30:53
04 Aug 2002 12:30:53 Dave Thomas replied:
I dunno, could I? If I get what your talking about Dave, what would the action be on the forms?
form 1 action = "page2"
form 2 action = "page3"
and then do as you say, stick them all together when I get to my "Send Page"
Am i on the right track?
"Get the kettle on, time for a brew"
Edited by - UltraDav on 04 Aug 2002 12:31:55
form 1 action = "page2"
form 2 action = "page3"
and then do as you say, stick them all together when I get to my "Send Page"
Am i on the right track?
"Get the kettle on, time for a brew"
Edited by - UltraDav on 04 Aug 2002 12:31:55
Replied 04 Aug 2002 18:00:02
04 Aug 2002 18:00:02 aegis kleais replied:
Page1.asp would have nothing. But the form action would send via POST and action would be page2.asp
On page2.asp you'd have code like:
Session("Name"
= Request.Form("name"
Session("Address"
= Request.Form("address"
etc.
Providing a session name to each field you want memorized. As long as session variables are enabled on the computer, it'll hold their info for the duration of the session.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
On page2.asp you'd have code like:
Session("Name"


Session("Address"


etc.
Providing a session name to each field you want memorized. As long as session variables are enabled on the computer, it'll hold their info for the duration of the session.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 04 Aug 2002 18:49:15
04 Aug 2002 18:49:15 Owen Eastwick replied:
It would be better not to use session variables, use a series of hidden fields instead, something like:
Page1.asp Form action="Page2.asp"
Then on page 2
<input type="hidden" name="hidTextValue1" value="Request("txtField1"
>
Then submit this to Page 3 and so on, on the final page insert all the hiddedn field values and the standard form fields into the database.
Reasons to limit the number of session variables:
www.4guysfromrolla.com/webtech/faq/Advanced/faq4.shtml
www.4guysfromrolla.com/webtech/092098-2.shtml
msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Page1.asp Form action="Page2.asp"
Then on page 2
<input type="hidden" name="hidTextValue1" value="Request("txtField1"

Then submit this to Page 3 and so on, on the final page insert all the hiddedn field values and the standard form fields into the database.
Reasons to limit the number of session variables:
www.4guysfromrolla.com/webtech/faq/Advanced/faq4.shtml
www.4guysfromrolla.com/webtech/092098-2.shtml
msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 04 Aug 2002 21:13:14
04 Aug 2002 21:13:14 Dave Thomas replied:
Thanks chaps,
I must admit, i was a bit wary of using the session to do it, Hidden fields sounds much better.
Thanks Owen, Aegis, Dave
"Get the kettle on, time for a brew"
I must admit, i was a bit wary of using the session to do it, Hidden fields sounds much better.
Thanks Owen, Aegis, Dave
"Get the kettle on, time for a brew"
Replied 05 Aug 2002 03:34:01
05 Aug 2002 03:34:01 Dave Clarke replied:
After reading those reasons not to use session variables, the use of hidden fields sounds much more attractive.
Replied 05 Aug 2002 13:27:43
05 Aug 2002 13:27:43 Dave Thomas replied:
Yeah Dave, I'd read the MS ASP tips one a while back. Just makes you more confused doesn't it m8. lol
Houston, we have a problem.
Ran the test with 4 pages consisting of
Page 1; frmName, frmEmail
Page 2; frmAddress, frmPOCode, frmTelephone
Page 3: frm DomainWanted, frm Extension
Page 4; frmHostingNeeded, frmTotalPrice.
All my hidden fields were transferred with names like "form_hide1, form_hide2, form_hide3 etc...
Now to allow the customer to preview all the data entered before sending, I made a new table on a preview page and tried to show the hidden fields using;
Request("frmName"
or
Request("form_hide1" or
Request.Form("frmName"
&
Request.Form("form_hide1"
but i cant get anything to preview, so I cant be sure that my data is being stored over the duration of the form..
please don't be to polite to tell me im doing something stupid or wrong, as i find constructive criticism the best way to learn. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
----------------------------------------------------
Attempt 2:
tried putting the fields into a DB and got success, BUT it wasnt the data that was entered but the hidden fields value.
I'm getting:-
Name: frmName
Address : frmAddress
etc.. like the values above.
Instead of the name and address i entered.
So I am obviously doing something wrong with the syntax.
"Get the kettle on, time for a brew"
Edited by - UltraDav on 05 Aug 2002 17:10:32
Edited by - UltraDav on 05 Aug 2002 17:16:09
Houston, we have a problem.
Ran the test with 4 pages consisting of
Page 1; frmName, frmEmail
Page 2; frmAddress, frmPOCode, frmTelephone
Page 3: frm DomainWanted, frm Extension
Page 4; frmHostingNeeded, frmTotalPrice.
All my hidden fields were transferred with names like "form_hide1, form_hide2, form_hide3 etc...
Now to allow the customer to preview all the data entered before sending, I made a new table on a preview page and tried to show the hidden fields using;
Request("frmName"

Request("form_hide1" or
Request.Form("frmName"

Request.Form("form_hide1"

but i cant get anything to preview, so I cant be sure that my data is being stored over the duration of the form..
please don't be to polite to tell me im doing something stupid or wrong, as i find constructive criticism the best way to learn. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
----------------------------------------------------
Attempt 2:
tried putting the fields into a DB and got success, BUT it wasnt the data that was entered but the hidden fields value.
I'm getting:-
Name: frmName
Address : frmAddress
etc.. like the values above.
Instead of the name and address i entered.
So I am obviously doing something wrong with the syntax.
"Get the kettle on, time for a brew"
Edited by - UltraDav on 05 Aug 2002 17:10:32
Edited by - UltraDav on 05 Aug 2002 17:16:09
Replied 05 Aug 2002 20:14:41
05 Aug 2002 20:14:41 Dave Clarke replied:
I think that using Request (either .querystring or .form) will only pass the value to the next page, so you would have to put the values in the next page and then pass them on again.
so form1 passes "username" and this is placed in a hidden field in form2, then when this form is submitted it passes the hidden value + the new values from your new form to form3, then all these are placed in hidden fileds in form3, then on submit it passes them on again along with your new form inputs and so on and so on.
I could be wrong but that's how I am seeing it.
so form1 passes "username" and this is placed in a hidden field in form2, then when this form is submitted it passes the hidden value + the new values from your new form to form3, then all these are placed in hidden fileds in form3, then on submit it passes them on again along with your new form inputs and so on and so on.
I could be wrong but that's how I am seeing it.
Replied 05 Aug 2002 22:09:33
05 Aug 2002 22:09:33 Dave Thomas replied:
Thats exactly what i'm already doing Dave.
Heres a further update, I've simplified the form just to have 2 pages.
Grrrrrrrrrrrr, this is doin my head in.
DB is updating easily enough with normal form fields, but hidden fields arent working.
Q. Am i supposed to enclose the value of hidden fields in a <% %> tag? Because when i do, it gives me an ODBC error because one of my fields is Null (When it's not!!!)
input type="hidden" name="EmailInput" value="Request("frmEmail"
if the value is inside a <% tag, then i get the error, if it's not, it writes "request("frmEmail"
" as the email address.
"Get the kettle on, time for a brew"
Heres a further update, I've simplified the form just to have 2 pages.
Grrrrrrrrrrrr, this is doin my head in.
DB is updating easily enough with normal form fields, but hidden fields arent working.
Q. Am i supposed to enclose the value of hidden fields in a <% %> tag? Because when i do, it gives me an ODBC error because one of my fields is Null (When it's not!!!)
input type="hidden" name="EmailInput" value="Request("frmEmail"

if the value is inside a <% tag, then i get the error, if it's not, it writes "request("frmEmail"

"Get the kettle on, time for a brew"
Replied 05 Aug 2002 22:54:02
05 Aug 2002 22:54:02 Owen Eastwick replied:
Format is:
<input type="hidden" name="EmailInput" value="<%= Request("frmEmail"
%>">
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<input type="hidden" name="EmailInput" value="<%= Request("frmEmail"

Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 05 Aug 2002 23:03:22
05 Aug 2002 23:03:22 Dave Thomas replied:
<font size=6>Owen your a star m8</font id=size6>
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
"Get the kettle on, time for a brew"
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
"Get the kettle on, time for a brew"