Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to navigate using radio and next buttons

    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.

  • #2
    Regular Coder ellisd5's Avatar
    Join Date
    Jun 2002
    Location
    Uk
    Posts
    160
    Thanks
    5
    Thanked 0 Times in 0 Posts
    have a function something like this

    Code:
    <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);" />
    Dale Ellis
    __________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •