Auto select a dropdown based off another dropdown when checkbox is checked
<p>I am working on a form with a two different sections.  Both sections have a few text fields and a drop down list.  There is also a checkbox in the second section that when checked auto fills the text fields with the information from the previous section.  I need to have the selected value from the drop down in the first section carry over when the checkbox is check too.  Any advice?  Thanks.</p>

<pre><code>$("input#sh_check").click(function(){ 
        if ($("input#sh_check").is(':checked')) 
        { 
            // Checked, copy values 
            $("input#sh_compname1").val($("input#st_compname1").val());
            $("input#sh_compname2").val($("input#st_compname2").val());
            $("input#sh_address1").val($("input#st_address1").val());
            $("input#sh_address2").val($("input#st_address2").val());
            $("select#sh_territory option:selected").val($("select#st_territory option:selected"));
        } 
        else 
        { 
            // Clear on uncheck 
            $("input#sh_compname1").val("");
            $("input#sh_compname2").val("");
            $("input#sh_address1").val("");
            $("input#sh_address2").val("");
            $("#sh_territory").val("");
        } 
    });
</code></pre>
