...

View Full Version : How to navigate using radio and next buttons



MeganD
12-05-2006, 06:27 PM
I'm trying to build a wizard that has groups of radio buttons corresponding to wizard questions. How can I set it up so that when the user selects radio button 1, then Next, he goes to one page? And if instead the user clicks radio button 2, then Next, he goes to a different page.
Thanks very much.

ellisd5
12-05-2006, 06:33 PM
have a function something like this


<SCRIPT>
funtion gotoPage(vForm) {
var nextPage = null;
for (i=0; i< vForm.length; i++) {
if (vForm.radioButs.checked) {
nextPage = vForm.radioButs[i].value;
break;
}
}
if (nextPage != null) {
document.location = nextPage;
} else {
alert("Please pick a page to visit");
}
}
</SCRIPT>
....
....
....
<INPUT TYPE="RADIO" NAME="radioButs" VALUE="page.html" />
<INPUT TYPE="RADIO" NAME="radioButs" VALUE="page2.html" />
<INPUT TYPE="RADIO" NAME="radioButs" VALUE="page3.html" />

<INPUT TYPE="button" VALUE=" Next " onClick="gotoPage(this.form);" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum