160
rated 0 times
[
162]
[
2]
/ answers: 1 / hits: 15150
/ 12 Years ago, wed, august 15, 2012, 12:00:00
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.
HTML:
<h3>Send Order As Gift</h3>
<ul>
<li class=fc_row fc_gift><label for=gift class=fc_pre>This is a gift,
please do not include a receipt.</label>
<input type=checkbox name=gift id=gift class=checkbox value= />
<input type=hidden name=Gift id=gift-true value= /></li>
<script type=text/javascript>
$(document).ready(function(){
$(#gift-true).input( $('#edit-checkbox-id').is(':checked').val() + Yes);
});
</script>
</li>
<li class=fc_row fc_gift_message><label for=Gift Message>Include a message
(limit 100 characters):</label>
<textarea name=Gift Message cols=50 rows=3 maxlength=100></textarea>
</li>
</ul>
More From » jquery