How to skip questions on a form using a command button

E

Eskymoe

I want to create a short 20 question survey using Frontpage. There is one
question per page. Basically a form that posts data to an Access database. I
won't be using Survey template or Sharepoint.

Problem:

The question for example "Do you drive a car to work" uses mutually
exclusive Yes/No radio buttons. I would like to be able to direct the user to
the next question (page) based on their answer. If they answer yes they would
go to Question 2. "What type of car" If they answered no they would be
directed to Question 3 "Do you catch the train"
In other words question 2 would be skipped based on the no response. I
imagine this could be achieved using a command button and some code.

Thankyou for your response.
 
K

Kevin Spencer

This could be achieved by writing a custom server-side application using ASP
or ASP.Net (or any of the "lesser players" in that technology arena). I
don't believe you will find anything ready-made to fit your specs.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
E

Eskymoe

Thanks Kevin

I have worked out how to navigate to different pages based on the answer
selected in the combo box. I have gone File create new web, new page and
saved page as a .asp I have put the following code in <head> section. It
works fine. However the problem is posting to the database. I can create the
db via form properties and it works ok however none of the results are saved.
Thanks for your help. Cheers Peter

Here is the code:

<p>Question 1: Do you drive a car
</p>

<form method="POST" name="SendMe">
<p><select name="DropIt" size="1">
<option> yes </option>
<option> no </option>
<option> unsure </option>
<option> declined to answer </option>
</select> <input type="button" name="B1" value="Submit">
<SCRIPT FOR="B1" EVENT="onClick" LANGUAGE="VBScript">
select case document.sendme.dropit.selectedindex
case 0
navigate("in here goes the page to skip to")
case 1
navigate("in here goes the page to skip to")
case 2
navigate("in here goes the page to skip to")
case 3
navigate("in here goes the page to skip to")
end select
</SCRIPT>
</form>
 
K

Kevin Spencer

Where's Kathleen when you need her? I'm sorry, Eskymoe, but I never use the
DRW, so I'm not familiar with its idiosynchrasies. There are others (like
Kathleen) here that can help with it though. Hopefully, one or more of them
will pick up this thread.

Best of luck to you!

Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

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