Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select option gives another form entry

Status
Not open for further replies.

evergreean43

Technical User
May 25, 2006
165
US
I need to create a form that has an initial question on a page called PageOne.cfm such as:
Do you live in San Diego?

If the Person says no it takes them to pageTwo.cfm
If the person answers yes it automatically adds another form entry on pageOne.cfm that asks if the Person is over 35. If the Person says yes then it takes them to pageThree.cfm. If the person says no it takes them to pageFour.cfm.

Here is my start but not need more assistance and guidance on the best way to do this.

Code:
<script>
function gotoYes()
{
     document.myFrm.action="pageOne.cfm";
}
function gotoNo()
{
     document.myFrm.action="pageTwo.cfm";
}
</script>
<form name="myFrm">
<input name"myvar" type="radio" onclick="gotoYes()" value="yes">

<input name"myvar" type="radio" onclick="gotoNo()" value="no">
.....
</form>

 
Re-check your code
Code:
<script>
function gotoYes()
{
     document.myFrm.action="pageOne.cfm";
}
function gotoNo()
{
     document.myFrm.action="pageTwo.cfm";
}
</script>
<form name="myFrm">
<input name[b]=[/b]"myvar" type="radio" onclick="gotoYes()" value="yes">

<input name[b]=[/b]"myvar" type="radio" onclick="gotoNo()" value="no">
.....
</form>

M. Brooks
 
A thought for you.
Changing pages for each question is clumsy for the user and tedious in creating multiple pages for very little benefit.

On your first page you are planning on either redirection if the question is answered negatively or adding an additional question to the same page if true. Why not extend that so that you just change questions on the same page for either answer?

You can build all of your additional questions on the page and set them not to display. When the displayed question is answered then you set the display visible for the next question appropriate to the response.


At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top