title: jQuery clearing the value for hidden fields prior to the submit
body: <p>I have a form that hides/shows fields based on a dropdown value.  If a user says they are bringing 5 guests by selecting 5 from the dropdown, they are given 5 name fields for the names of their guests.  I would like to clear the name fields of hidden inputs prior to submission to ensure that the user doesn't choose 5 guests, fill them in, then click 2 from the dropdown and submit the form thinking they are choosing 2 guests(when in reality they are submitting data for 5 guests).  I know I can set the value by using </p>
  
  <pre><code>$('input:hidden').val('')
  </code></pre>
  
  <p>but I can't seem to make this happen before submission.  I also tried putting the above in the event handler for the dropdown but that won't work for some reason:  </p>
  
  <pre><code>guestNumberInput.change(function () {
      var inputNumber = $(this).val();
      $(".guest-options").children().slice(0, inputNumber).show(guestTransition);
      $(".guest-options").children().slice(inputNumber).hide(guestTransition);
      $('input:hidden').val('');
  
    });
  </code></pre>
  
  <p>Im sorry if this is a noob question but I am just starting with jQuery. </p>