title: jQuery Check if Checkbox is Checked, then Add Value to Input Field
body: <p>I have a shopping cart checkout page and I'm trying to add a "gift" option. What needs to happen: Once the checkbox is selected for "Send Order As Gift", a value needs to be assigned to a hidden input field so that the information is moved onto the confirmation page and various receipts.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;h3&gt;Send Order As Gift&lt;/h3&gt;
  &lt;ul&gt;
      &lt;li class="fc_row fc_gift"&gt;&lt;label for="gift" class="fc_pre"&gt;This is a gift, 
      please do not include a receipt.&lt;/label&gt;
      &lt;input type="checkbox" name="gift" id="gift" class="checkbox" value="" /&gt;
      &lt;input type="hidden" name="Gift" id="gift-true" value="" /&gt;&lt;/li&gt;
      &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $("#gift-true").input( $('#edit-checkbox-id').is(':checked').val() + "Yes"); 
      });​                
      &lt;/script&gt;
      &lt;/li&gt;
      &lt;li class="fc_row fc_gift_message"&gt;&lt;label for="Gift Message"&gt;Include a message 
      (limit 100 characters):&lt;/label&gt;
      &lt;textarea name="Gift Message" cols="50" rows="3" maxlength="100"&gt;&lt;/textarea&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>