"Skip logic" in a web-based survey

B

Bob V

I would like to be able to send a survey taker to one of
three surveys based on which option (of 3) they select. Is
there a way to do that through a form? I might like to
record some demographic data on the first page, and then
based on which option they select, send them to a unique
survey.

Any suggestions?
 
C

clintonG

You can use VBScript If-Then conditional logic or a Select Case
statement. When there are multiple items involved that take on the
context of a list I prefer the Select Case statement as it is easy to build,
easy to read, easy to add to, and easy to maintain.


Dim sSelectedOption
sSelectedOption = the form value i.e. Option1, Option2
etc.

Select Case sSelectedOption

Case "Option1"
Response.Clear
Response.Redirect "survey1.asp"

Case "Option2"
Response.Clear
Response.Redirect "survey2.asp"

Case "Option3"
Response.Clear
Response.Redirect "survey3.asp"

Case Else
Response.Clear
Response.Redirect "wherever.asp"

End Select

That is server-side VBScript and your circumstances may require
a variation. This task can be written in client-side JavaScript as well and
again, circumstances may determine which script language to use.

I don't understand what you mean by "record some demographic
data on the first page" and assume you mean store the demographic
data in a database. That's a whole other set of issues.


--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/
 

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

Top