title: Do I use Javascript for HTML <select> needs to affect two variables?
body: <p>I'm currently working on a paypal checkout form.  The form allows the user to specify a few options and when they submit the form, it submits the order to paypal for processing.</p>
  
  <p>The form has a <code>&lt;select&gt;</code> droplist that allows a user to select how many times they want a subscription to recur.  It is set up like this:</p>
  
  <pre><code>&lt;select name="srt"&gt;                         &lt;!-- User specifies amount of times payment should recur --&gt;
      &lt;option value="1"&gt;&lt;/option&gt;
      &lt;option value="2"&gt;&lt;/option&gt;  
      &lt;option value="3"&gt;&lt;/option&gt;  
  &lt;/select&gt;
  &lt;input type="hidden" name="src" value="1"&gt;   &lt;!-- Specifies that payment should be recurring--&gt;
  </code></pre>
  
  <p>This works in most cases, however when the user selects the first option with the <code>srt</code> <code>value="1"</code>, paypal instead wants this to be submitted with <code>srt</code> blank or omitted and <code>src</code> (the hidden input below the form) with <code>value="0"</code>.  The reason for this seems to be that if the payment is to recur 1 time, meaning to charge the customer only once, then this is not a recurring payment at all, so <code>srt</code> is not valid and instead <code>src</code>, which specifies if payments should recur or not, should be set to <code>0</code>.</p>
  
  <p>I'm wondering what is the best way to handle this.  The only thing I can think of is to use javascript to set hidden form values depending on what the user selects in a <code>&lt;select&gt;</code> drop list.</p>
  
  <p>Is that the best way to handle this, or is there a better way that does not require the browser to handle javascript?</p>
  
  <p>Thanks!</p>