Allows the user to click a checkbox and make the Mailing Fields
the same as the Billing Fields. If they uncheck it, it will clear
the fields.


Just put this at the top of the page somwhere in the <head> tags.


<SCRIPT LANGUAGE="JavaScript">
// <!--
function shipsame(form){

if(form.sameasbilling.checked){

     form.Mailing_First_Name.value = form.Billing_First_Name.value;
     form.Mailing_Last_Name.value = form.Billing_Last_Name.value;
     form.Mailing_Address.value = form.Billing_Address.value;
     form.Mailing_City.value = form.Billing_City.value;
     form.Mailing_Zip.value = form.Billing_Zip.value;
     
     if(form.Billing_State.type == "select-one"){
          var bStateIdx = form.Billing_State.selectedIndex;
          form.Mailing_State.options[bStateIdx].selected = true;
     }
     else{
          form.Mailing_State.value = form.Billing_State.value;
     }
}
else{
     form.Mailing_First_Name.value = "";
     form.Mailing_Last_Name.value = "";
     form.Mailing_Address.value = "";
     form.Mailing_City.value = "";
     if(form.Mailing_State.type == "select-one"){
          form.Mailing_State.options[0].selected = true;
     }
     else{
          form.Mailing_State.value = "";
     }
     form.Mailing_City.value = "";
     form.Mailing_Zip.value = "";
}
}
//-->
</script>


Here's the checkbox for the <form>. Put this right above the mailing fields:

Same As Billing:
<input type="checkbox" name="sameasbilling" value="checkbox"
       onClick="shipsame(this.form);">