title: select giving wrong values
body: <p>I am creating a data entry form for a school. The school will be entering data in this database for their 5th till 12th grade students. Now 5th grade has 4 sections and all other grade has 3 sections. 10th grade has only one section. </p>
  
  <p>The form is ready and using jquery i am able to make the section select element either show or hide depending on the grade the user selects. My problem is when the user selects std as 5th the section select element is shown and the user selects say "A" and submits. But the value i get is 0. If the user selects section as "D" , the value being sent is "B". </p>
  
  <p>The section select for all other grades are working fine, this problem arises only when the grade selected is 5th.</p>
  
  <p><strong>Script</strong></p>
  
  <pre><code>&lt;script type='text/javascript' src='scripts/jquery-1.5.2.js'&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;//&lt;![CDATA[ 
  $(window).load(function(){
  $("#std").change(function() {
          var value = $(this).val();
          if(parseInt(value)==0) {
             $("#sec5").hide();
             $("#sec6").hide();
          }
          if(parseInt(value)==5) {
              $("#sec5").show();
              $("#sec6").hide();
          }
          if(parseInt(value)==6) {
             $("#sec5").hide();
             $("#sec6").show();
          }
          if(parseInt(value)==7) {
             $("#sec5").hide();
             $("#sec6").show();
          } 
      if(parseInt(value)==6) {
         $("#sec5").hide();
         $("#sec6").show();
      }
      if(parseInt(value)==8) {
         $("#sec5").hide();
         $("#sec6").show();
      }
      if(parseInt(value)==9) {
         $("#sec5").hide();
         $("#sec6").show();
      }
      if(parseInt(value)==10) {
         $("#sec5").hide();
         $("#sec6").hide();
      }
      if(parseInt(value)==11) {
         $("#sec5").hide();
         $("#sec6").show();
      }
      if(parseInt(value)==12) {
         $("#sec5").hide();
         $("#sec6").show();
      }
  });
  
  });//]]&gt; 
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML Part</strong></p>
  
  <pre><code>&lt;form action="check.php" method="post"&gt;
      &lt;fieldset&gt;
        &lt;legend&gt;DBMS&lt;/legend&gt;
        &lt;label for="roll"&gt;Roll:
          &lt;input name="roll" type="text" id="roll" value="" size="8" maxlength="10" /&gt;
        &lt;/label&gt;
        &amp;nbsp;
        &lt;label for="marks"&gt;Total Marks:
          &lt;input name="marks" type="text" id="marks" value="" size="3" maxlength="3" /&gt;
        &lt;/label&gt;
        &amp;nbsp;
        &lt;label for="std"&gt;Std&lt;/label&gt;
        &lt;select id="std" name="std"&gt;
          &lt;option value="0"&gt;--Select--&lt;/option&gt;
          &lt;option value="5"&gt;5&lt;/option&gt;
          &lt;option value="6"&gt;6&lt;/option&gt;
          &lt;option value="7"&gt;7&lt;/option&gt;
          &lt;option value="8"&gt;8&lt;/option&gt;
          &lt;option value="9"&gt;9&lt;/option&gt;
          &lt;option value="10"&gt;10&lt;/option&gt;
          &lt;option value="11"&gt;11&lt;/option&gt;
          &lt;option value="12"&gt;12&lt;/option&gt;
        &lt;/select&gt;
        &lt;span id="sec5" class="hide"&gt;
        &amp;nbsp;
        &lt;label for="sec"&gt;Section&lt;/label&gt;
        &lt;select id="sec" name="sec"&gt;
          &lt;option value="0"&gt;--Select--&lt;/option&gt;
          &lt;option value="A"&gt;Sec A&lt;/option&gt;
          &lt;option value="B"&gt;Sec B&lt;/option&gt;
          &lt;option value="C"&gt;Sec C&lt;/option&gt;
          &lt;option value="D"&gt;Sec D&lt;/option&gt;
        &lt;/select&gt;
        &lt;/span&gt; &lt;span id="sec6" class="hide"&gt;
        &amp;nbsp;
        &lt;label for="sec"&gt;Section&lt;/label&gt;
        &lt;select id="sec" name="sec"&gt;
          &lt;option value="0"&gt;--Select--&lt;/option&gt;
          &lt;option value="A"&gt;Sec A&lt;/option&gt;
          &lt;option value="B"&gt;Sec B&lt;/option&gt;
          &lt;option value="C"&gt;Sec C&lt;/option&gt;
        &lt;/select&gt;
        &lt;/span&gt;
        &lt;p align="center"&gt;
          &lt;input type="submit" name="nlogin" id="nlogin" value="Submit" /&gt;
          &amp;nbsp;
          &lt;input type="reset" name="nreset" id="nreset" value="Reset" /&gt;
        &lt;/p&gt;
      &lt;/fieldset&gt;
    &lt;/form&gt;
  </code></pre>