title: Using jQuery to remove select field values from the DOM before submit?
body: <p>I've got a squarespace form I'm working on that uses jQuery to show/hide certain fields to allow a custom form using show(); and hide();</p>
  
  <pre><code>$(".option2 select").hide();
  </code></pre>
  
  <p>The problem is that this doesn't remove them from the DOM, and so any hidden fields are STILL submitted in the squarespace email.</p>
  
  <pre><code>$(".option2 select").remove();
  </code></pre>
  
  <p>This is the only function that successfully removes the select from the DOM and stops it from being included in the form submit, but since it's irreversible, it breaks the form.</p>
  
  <p>Is there a way to use remove(); on certain elements just as the submit button is pressed to permanently remove them from the DOM before the form is actually submitted?</p>
  
  <p>Edit: I should clarify that since this is done in Squarespace, it's tricky to use onSubmit since there are already other things going on. I'm looking for a jQuery-only solution that doesn't involve editing any of the HTML of the form in any way.</p>