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!

Skip Pattern

Status
Not open for further replies.

mr2062

MIS
Oct 28, 2008
1
US
I'm writing a long online questionnaire that needs several skips. The html code posted is an
example on my need.

If the respondent answers "Do not listen to Music" we would just skip to "Thanks"


<script type="text/javascript>
<!--

function skip1_radio_value()
{
for (var i=0; i < document.musicform.scrn.length; i++)
{
if (document.musicform.scrn.checked)=1 /Continue to the next question
if (document.musicform.scrn.checked)=2 /Continue to to "Thanks for your time."
}
}

//-->
</script>


<form name="musicform">
Do you listen to music?<br>
<input type="radio" name="scrn" value="1" checked="checked"> Yes<br>
<input type="radio" name="scrn" value="2"> No<br>
<input type="submit" onclick="get_radio_value()"><br><br>

Which one is your favorite music?<br>
<input type="radio" name="music" value="1" checked="checked"> Rock<br>
<input type="radio" name="music" value="2"> Reggae<br>
<input type="radio" name="music" value="3"> Pop<br>
<input type="radio" name="music" value="4"> Rap<br>
<input type="radio" name="music" value="5"> Metal<br>
<input type="submit" value="Submit" class="Send" id="submit" />


<br>
Thanks for your time. <br>


</form>
 
Where are you calling the skip1_radio_value function? Shouldn't it be fired on the selection event?

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top