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

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.

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

funtion gotoPage(vForm) {
var nextPage = null;
for (i=0; i< vForm.length; i++) {
if (vForm.radioButs.checked) {
nextPage = vForm.radioButs[i].value;
if (nextPage != null) {
document.location = nextPage;
} else {
alert("Please pick a page to visit");
<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);" />