form based on previous selections (Full Version)

All Forums >> [Web Development] >> Expression Web Help



Message


shoky -> form based on previous selections (11/9/2007 19:46:53)

I need to build a form running multiple pages. The First field/page is selecting from a radio button list. One of these selections (contractor) should open a different form from all the other selections. Also on the Second page another field will have selections that will add additional fields to the Third page - and the Third page will send all data from the three pages by email

Any ideas on the best way to do it? The end result will be sent by mail only - so I'm trying to figure out a way to do it with out a database.




BobbyDouglas -> RE: form based on previous selections (11/9/2007 21:06:34)

The way I would tackle this, is create the 3 pages first.

The first page will have a form that posts to the second page, then the second page will have a form that posts the first page's info, and the second page's info to the 3rd page. The 3rd page will make sure that there are posted values from the 1st and 2nd pages (to make sure spammers aren't using the form, and that the 3rd page was accessed by the 1st and 2nd page).

Here's an ASP tutorial explaining the method behind this: ASP Forms




shoky -> RE: form based on previous selections (11/9/2007 21:23:30)

What I need the help with is some code like this on the second page: <% If Request.Form("Customer_Type") = "Contractor" Then %>
'THEN' would display one form and then have an ELSE IF to display the other form - same kind of thing needed on the third page - can it be done?

Don't have a lot of experience with .aspx but I want to build it in Expression.
*****************************************************************
OK here's the basic code I came up with, and it works:

<% Dim cstype=request.querystring("Customer_Type")
If cstype="Contractor" then%>
Hi.</p>
<p class="style5">You must be the Contractor. Please complete the form
<form method="post" action="" class="style5">
<input type="hidden" name="Customer_Type" value='<%=Request.querystring(" Customer_Type" )%>" ' />
<input name="Customer_Type" type="text" value='<%=Request.querystring("Customer_Type")%>' /></form>
<p class="style5"> </p>

<%else%>
<p class="style5">Hi!<p class="style5">Please complete the form
form method="post" action="" class="style5">
<input type="hidden" name="Customer_Type" value='<%=Request.querystring(" Customer_Type" )%>" ' />
<input name="Customer_Type" type="text" value='<%=Request.querystring("Customer_Type")%>' /></form>
<p class="style5">
</p></p></p>
<%end if%>




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125