jquery branching in a form
<p>A few months ago I thought I would "have a go" at creating a sign up form with no experience at all with jquery or java except copying and pasting code that works ok into my web pages.
I made a pretty fancy form up but it wont work with validation.
I have several branches in the form i.e. 2 radio buttons labelled business and private. If you click business it asks one set of questions and if you click private another set. 
I am having difficulty locating anything that explains how I "switch off" the unused questions or how to do a branch that is a separate pathway.
If someone could direct me to a tutorial that gives me a clue that would be great or any other help would be appreciated.
Here is the code I have so far.</p>

<pre><code>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Plans&lt;/TITLE&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Join Now&lt;/title&gt;
&lt;script type="text/javascript" src="js/jquery-1.5.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/jquery.validate.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/additional-methods.min.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
    $(document).ready(function()
//1
    {
                $('.newp').hide();                  //hide all div 
                $('.tranp').hide();
                $('.bushom').hide();
                $('.diffadd').hide();
                $('.tac').hide();
                $('.conadd').hide();
                $('.subbut').hide();
                $('#newp').click(function()
                {
                        $('.tranp').slideUp('slow');        //where there is an alternate use slide
                        $('.newp').slideDown('slow');
            $('.bushom').show('slow');      //if no alternate use show. if it should not be shown in another sequence use hide
                });
                $('#tranp').click(function()
                {
                        $('.newp').slideUp('slow');
                        $('.tranp').slideDown('slow');
                        $('.bushom').show('slow');
                });     
//2
                $('.busu').hide();
                $('.homeu').hide();
                $('.tac').hide();
                $('.conadd').hide();
                $('.subbut').hide();
                $('#busu').click(function()
                {
        //        $('.newp').hide();
        //        $('.tranp').hide();
                        $('.homeu').slideUp('slow');
                        $('.busu').slideDown('slow');
            $('.diffadd').show('slow');
                });
                $('#homeu').click(function()
                {
        //        $('.newp').hide();                //an example of how we can hide completed pages so there is not to much on the screen
        //        $('.tranp').hide();
                        $('.busu').slideUp('slow');
                        $('.homeu').slideDown('slow');
            $('.diffadd').show('slow');
                });     
//3
                $('.addsame').hide();
                $('.adddif').hide();
                $('.conadd').hide();
                $('.tac').hide();
                $('.subbut').hide();
                $('#addsame').click(function()
                {
                        $('.conadd').hide('slow');          //here is an example where a page has to hide in one sequence but be shown in another
                        $('.tac').show('slow');
                });
                $('#adddif').click(function()
                {
                        $('.conadd').show('slow');
                        $('.tac').show('slow');
                });     

                $('.addsame').hide();
                $('.adddif').hide();
                $('.conadd').hide();
                $('.tac').hide();
                $('.agree').hide();
                $('.subbut').hide();
                $('#agree').click(function()
        {
                        $('.subbut').show('slow');
                });

/*
       $("#signupForm").validate({
                rules: {
                        stnantr: "required",
                        subtr: "required",
                        citytr: "required",
                        stnannw: "required",
                        suburbnw: "required",
                        citynw: "required"

newtran:
{
    required: function(){
        if($("select[name=newtran]").val() == 1){
            return true;
        }
        else
        {
            return false;
        }
    }
}

        $("#bushom").validate({
        if(newtran=='trans') {
                rules: {
            stnantr: "required",
            subtr: "required",
            citytr: "required"
                        }
                }
        else {
                rules: {
                        stnannw: "required",
                        suburbnw: "required",
                        citynw: "required"
                        }       

                },
                messages: {
            stnantr: "required",
                        subtr: "required",
                        citytr: "required",
            stnannw: "required",
                        suburbnw: "required",
                        citynw: "required"
                }
        });

*/
    });

&lt;/script&gt;
&lt;style type="text/css"&gt;
    #content { 
    width: 600px; 
    margin: 1px auto; 
    padding: 25px;
    color: #fff;
    border: 10px solid #666699;
    font-family: Helvetica, Arial, sans-serif; 
    font-size: 10px; 
    }
    h2 { 
        color: #666;
        font-family: Arial, Helvetica, sans-serif;
    font-size: 12px; 
        font-weight: bold;
    }
    .option {
    color: #555; 
    font-family: Helvetica, Arial, sans-serif; 
    font-weight: bold; 
    font-size: 10px; 
    margin-right: 20px; 
    }
    .detail {       
    width: 500px;  
    margin-bottom: 15px; 
    color: #333; 
    font-family: Helvetica, Arial, sans-serif; 
    font-size: 10px; 
    }
    a { 
    color: #3399CC; 
    text-decoration: none; 
    font-weight: bold; 
    }
    a:hover { 
    text-decoration: underline; 
    }
    label { 
        color: #666;
        font-family: Arial, Helvetica, sans-serif;
    font-weight: bold; 
    font-size: 10px; 
    }
    label.error {
        float: none;
        color: red;
        padding-left: .5em;
        vertical-align: top;
    }   

        legend {
        color: #666;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: bold;

    font-size: 10px; 
    font-family: Helvetica, Arial, sans-serif; 
        }
    .input { 
    color: #666; 
    font-family: Arial, Helvetica, sans-serif; 
    border: 1px solid #336666;
    padding: 3px;
    margin-bottom: 5px;
    }
    input.button {
    background: #000;
    border: 1px solid #666;
    color: #fff;
    padding: 3px;
    font-size: 10px; 
        font-family: Arial, Helvetica, sans-serif;
    }

&lt;/style&gt;

&lt;META content="MSHTML 6.00.2462.0" name=GENERATOR&gt;&lt;/HEAD&gt;
&lt;BODY text=#666666 vLink=#800080 link=#0000FF bgColor=#006699 topMargin=0 marginwidth="0" marginheight="0"&gt;
&lt;div style="background-image:url(images/bg.jpg);
    background-repeat:no-repeat;
    background-position:center;
    width:100%;
    height:100%;"&gt;
&lt;TABLE bgColor=#ffffff cellSpacing=0 cellPadding=0 width=700 border=0 ALIGN="center"&gt;
      &lt;TR&gt; 
    &lt;!--MAIN AD AREA--&gt; 
    &lt;TD vAlign=top align=top width=370 height="293"&gt; 
        &lt;div align="top"&gt;&lt;/div&gt;

        &lt;p align="top"&gt;
    &lt;style='mso-bidi-font-weight:bold'&gt;&lt;span style='font-size:18pt;font-family:Arial;mso-bidi-font-family:"Arial, Helvetica, sans-serif";color:blue'&gt;Join Now
        &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

        &lt;div align="top"&gt;&lt;/div&gt;
&lt;div id="content"&gt;
    &lt;form id="signupForm" method="POST" action="processform.php"&gt;
        &lt;div&gt;
             &lt;fieldset&gt;
        &lt;legend&gt;Question 1&lt;/legend&gt;&lt;br /&gt;
                &lt;div class="detail"&gt;Do you want to TRANSFER an EXISTING phone number &lt;br /&gt;OR&lt;br /&gt;
        Do you want to INSTALL a NEW Service&lt;/div&gt;&lt;br /&gt;
                &lt;input type="radio" name="newtran" value="tranp" id="tranp" /&gt; &lt;span class="option"&gt; Transfer EXISTING Service&lt;/span&gt;
        &lt;input type="radio" name="newtran" value="newp" id="newp" /&gt;&lt;span class="option"&gt; Install a NEW Service&lt;/span&gt;
        &lt;br /&gt;&lt;br /&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;

        &lt;div class="tranp"&gt;&lt;br /&gt;
            &lt;fieldset&gt;
                        &lt;legend&gt;TRANSFER an EXISTING Service&lt;/legend&gt;&lt;br /&gt;
                        &lt;label for="tranphtr"&gt;Existing Phone Number&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="tranphtr" class="input" id="tranphtr"/&gt;&lt;br /&gt;
                        &lt;label for="cprovtr"&gt;Current Provider&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="cprovtr" class="input" id="cprovtr"/&gt;&lt;br /&gt;
                        &lt;label for="anumtr"&gt;Account Number&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="anumtr" class="input" id="anumtr"/&gt;&lt;br /&gt;
            &lt;/fieldset&gt;
            &lt;br /&gt;
            &lt;fieldset&gt;
                        &lt;legend&gt;ADDRESS of EXISTING Service&lt;/legend&gt;&lt;br /&gt;
                        &lt;label for="stnantr"&gt;Street Number and Name&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="stnantr" class="input" id="stnantr"/&gt;&lt;br /&gt;
                        &lt;label for="suburbtr"&gt;Suburb&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="suburbtr" class="input" id="suburbtr"/&gt;&lt;br /&gt;
                        &lt;label for="citytr"&gt;City&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="citytr" class="input" id="citytr" /&gt;&lt;br /&gt;
                        &lt;label for="pcodetr"&gt;Post Code&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="pcodetr" class="input" id="pcodetr"/&gt;&lt;br /&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;

        &lt;div class="newp"&gt;&lt;br /&gt;
                            &lt;fieldset&gt;
            &lt;legend&gt;Customer Service Agreement&lt;/legend&gt;&lt;br /&gt;
            &lt;div class="detail"&gt;
            When ordering a NEW phone service there is a right to recourse if the installation is delayed for any reason under the telecommunications act 
            called the CUSTOMER SERVICE AGREEMENT.&lt;br /&gt;&lt;br /&gt;
            If you require this protection against delays in connecting your new service please check the box labelled REQUIRE.&lt;br /&gt; &lt;br /&gt;
            If you decide to waive your protection under the act please check the box labelled WAIVE.&lt;br /&gt; &lt;br /&gt;
            There is a substantial difference in the price if you WAIVE your rights under the telecommunications act.&lt;br /&gt;&lt;br /&gt;
            It will take the same time to install the phone if you are covered or waive your rights the difference is you have a right to 
            recourse if there is an unforseen delay.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
            &lt;h2&gt;WAIVE&lt;/h2&gt;
                    &lt;input type="radio" name="waivereq" value="waive" id="wav" /&gt; &lt;span class="option"&gt;
            I WAIVE the CUSTOMER SERVICE AGREEMENT and will pay an installation fee of $70&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
            &lt;h2&gt;REQUIRE&lt;/h2&gt;
                    &lt;input type="radio" name="waivereq" value="require" id="req" /&gt;&lt;span class="option"&gt;
            I REQUIRE the CUSTOMER SERVICE AGREEMENT and will pay an installation fee of $200&lt;/span&gt;
                            &lt;/fieldset&gt;
                    &lt;fieldset&gt;
                        &lt;legend&gt;Enter the ADDRESS where the NEW phone service is LOCATED&lt;/legend&gt;&lt;br /&gt;
                        &lt;label&gt;Street Number and Name&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="stnannw" class="input" id="stnannw"/&gt;&lt;br /&gt;
                        &lt;label&gt;Suburb&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="suburbnw" class="input" id="suburbnw"/&gt;&lt;br /&gt;
                        &lt;label&gt;City&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="citynw" class="input" id="citynw" /&gt;&lt;br /&gt;
                        &lt;label&gt;Post Code&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="pcodenw" class="input" id="pcodenw"/&gt;&lt;br /&gt;
                    &lt;/fieldset&gt;
        &lt;/div&gt;

            &lt;br /&gt;
        &lt;div class="bushom"&gt;
            &lt;fieldset&gt;
                        &lt;legend&gt;Question 2&lt;/legend&gt;&lt;br /&gt;
            &lt;div class="detail"&gt;Is this Phone Service for Home or Business Use &lt;br /&gt;&lt;/div&gt;
                    &lt;input type="radio" name="hombus" value="homeuse" id="homeu" /&gt; &lt;span class="option"&gt;For Home Use&lt;/span&gt;
            &lt;input type="radio" name="hombus" value="bususe" id="busu" /&gt;&lt;span class="option"&gt;For Business Use&lt;/span&gt;
            &lt;br /&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
                &lt;div class="homeu"&gt;&lt;br /&gt;
                            &lt;fieldset&gt;
                                &lt;legend&gt;HOME Use&lt;/legend&gt;&lt;br /&gt;
                    &lt;label for="firstnamehm"&gt;Firstname:&lt;/label&gt;&lt;br /&gt;
                                &lt;input type="text" id="firstnamehm" class="input" name="firstnamehm" /&gt; *&lt;br /&gt;
                                &lt;label for="lastnamehm"&gt;Lastname:&lt;/label&gt;&lt;br /&gt;
                                &lt;input type="text" id="lastnamehm" class="input" name="lastnamehm" /&gt; *&lt;br /&gt;
                                &lt;label for="emailhm"&gt;Email:&lt;/label&gt;&lt;br /&gt;
                                &lt;input type="text" id="emailhm" class="input" name="emailhm" /&gt;&lt;br /&gt;
                                &lt;label for="phonehm"&gt;Contact Phone:&lt;/label&gt;&lt;br /&gt;
                                &lt;input type="text" id="phonehm" class="input" name="phonehm" /&gt; *&lt;br /&gt;     
                            &lt;/fieldset&gt;
                &lt;/div&gt;
                        &lt;div class="busu"&gt;&lt;br /&gt;
                                    &lt;fieldset&gt;
                                        &lt;legend&gt;BUSINESS Use&lt;/legend&gt;&lt;br /&gt;
                        &lt;div class="detail"&gt;
                        &lt;fieldset&gt;1. For Business use the cost of the service is $6 extra per month
                        &lt;br /&gt;This fee is for a standard entry in Yellow Pages&lt;br /&gt;&lt;br /&gt;
                        2. The contact person should be the person responsible for making decisions and billing for this service.&lt;br /&gt;
                        Usually the proprietor or a director of the business&lt;br /&gt; 
                        &lt;/fieldset&gt;
                        &lt;div&gt;&lt;br /&gt;
                                        &lt;label for="busnamebs"&gt;Business Name:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="busnamebs" class="input" name="busnamebs" /&gt; *&lt;br /&gt;
                                        &lt;label for="abnnbs"&gt;ABN:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="abnnbs" class="input" name="abnnbs" /&gt; *&lt;br /&gt;
                                        &lt;label for="firstnamebs"&gt;Firstname:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="firstnamebs" class="input" name="firstnamebs" /&gt; *&lt;br /&gt;
                                        &lt;label for="lastnamebs"&gt;Lastname:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="lastnamebs" class="input" name="lastnamebs" /&gt; *&lt;br /&gt;
                                        &lt;label for="emailbs"&gt;Email:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="emailbs" class="input" name="emailbs" /&gt;&lt;br /&gt;
                                        &lt;label for="phonebs"&gt;Contact Phone:&lt;/label&gt;&lt;br /&gt;
                                        &lt;input type="text" id="phonebs" class="input" name="phonebs" /&gt; *&lt;br /&gt;
                                    &lt;/fieldset&gt;
                        &lt;/div&gt;
                        &lt;br /&gt;
                &lt;div class="diffadd"&gt;
                    &lt;fieldset&gt;
                &lt;legend&gt;Contact Address&lt;/legend&gt;&lt;br /&gt;
                     &lt;div class="detail"&gt;
                                           &lt;fieldset&gt;Is the SERVICE ADDRESS (above) the same as your CONTACT ADDRESS&lt;br /&gt;
                                           &lt;/fieldset&gt;
                                            &lt;div&gt;&lt;br /&gt;
                &lt;input type="radio" name="adiff" value="addsame" id="addsame" /&gt; &lt;span class="option"&gt;YES&lt;/span&gt;
                &lt;input type="radio" name="adiff" value="adddif" id="adddif" /&gt;&lt;span class="option"&gt;NO&lt;/span&gt;
                &lt;br /&gt;
               &lt;/fieldset&gt;
           &lt;/div&gt;
        &lt;div class="conadd"&gt;&lt;br /&gt;
                    &lt;fieldset&gt;
                        &lt;legend&gt;Contact Address&lt;/legend&gt;&lt;br /&gt;
                        &lt;label&gt;Street Number and Name&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="constreetnan" class="input" id="constreetnan"/&gt;&lt;br /&gt;
                        &lt;label&gt;Suburb&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="consuburb" class="input" id="consuburb"/&gt;&lt;br /&gt;
                        &lt;label&gt;City&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="concity" class="input" id="concity" /&gt;&lt;br /&gt;
                        &lt;label&gt;Post Code&lt;/label&gt;&lt;br /&gt;
                        &lt;input type="text" name="conpcode" class="input" id="conpcode"/&gt;&lt;br /&gt;
                    &lt;/fieldset&gt;
        &lt;/div&gt;

    &lt;div class="tac"&gt;&lt;br /&gt;
        &lt;div class="detail"&gt;
                &lt;fieldset&gt;
                &lt;legend&gt;Customer Authority.&lt;/legend&gt;&lt;br /&gt;&lt;br /&gt;
            &lt;textarea rows="15" cols="65" readonly&gt;
Customer Authority.
AN AUTHORITY TO SUPPLY A NEW TELEPHONE SERVICE OR TRANSFER AN EXISTING SERVICE.

        &lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;
        &lt;h2&gt;&lt;input type="checkbox" name="agree" value="agree" id="agree"&gt;I agree to the Terms &amp; Conditions.&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/fieldset&gt;
                &lt;/div&gt;
        &lt;/div&gt;
          &lt;div class="subbut"&gt;&lt;br /&gt;
                        &lt;fieldset&gt;
                        &lt;input class="button" type="submit" value="Submit"/&gt;
                        &lt;/fieldset&gt;
          &lt;/div&gt;

    &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>~end snip</p>
