- type:
- snippet
- category:
- checkout
- name:
- Making shipping address fields mirror billing fields
- versions:
- 070
- reference:
- http://forum.foxycart.com/comments.php?DiscussionID=3756
- date:
- 2011-05-27
Making shipping address fields mirror billing fields
Making shipping address fields mirror billing fields if the “Use billing address for shipping address” checkbox is checked.
<script type="text/javascript"> jQuery(document).ready(function($) { $("#fc_form_checkout input").blur(function() { if (!$("#use_different_addresses").is(":checked")) { var names = ["first_name","last_name","company","address1","address2","city","state_name","postal_code","phone"]; for (var i in names) { $("#shipping_"+names).val($("#customer_"+names).val()); } } }); }); </script>