Adding time to a date timestamp based on user's selection
<p>I have a form where jQuery is already being used on page load to change a value to a timestamp with the following format: 20110424.  It's a hidden input field:</p>

<pre><code>&lt;input type="hidden" name="sub_enddate" value="1" /&gt;
</code></pre>

<p>Which when the page is run, the value of "1" gets changed to one month out.  If "2" is in the value, the value of 2 is replaced with "20110524" and so on.  It's using the following code to make this change: <a href="http://pastie.org/1708677" rel="nofollow">http://pastie.org/1708677</a></p>

<p>What I'm trying to do now is change the date value above based on select values a user chooses.  Here's the select options:</p>

<pre><code>&lt;select name="Membership Duration"&gt;
&lt;option value=""&gt;Select A Membership Duration&lt;/option&gt;
&lt;option class="mos6" value="6 Months{p+220}"&gt;6 Month Membership&lt;/option&gt;
&lt;option class="mos3" value="3 Months{p+240}"&gt;3 Month Membership&lt;/option&gt;
&lt;option class="mos1" value="1 Months{p+260}"&gt;1 Month Membership&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>As you can see, I've attached a class to each option in the select dropdowns (i.e. mos6).  What I'm attempting to do is change the value of the timestamp explained above based on what the user chooses.  For example, if the user chooses "3 Month Membership", since this option has a class of 3, the timestamp will be modified to reflect 3 months from today's date (so effectively adding 2 months onto the existing timestamp in the hidden input field above.  If "6 Month Membership" is chosen, the date will be modified to 6 months from today's date and so on.  If the hidden input field above is a bad idea and we should just create a timestamp instead based on the dropdown options, I'm cool with that.</p>

<p>Thanks!</p>
