Jump to content

Checkbox Autofill


cjbeck71081

Recommended Posts

I am trying to code address information, where Owner name and Company name may be different or they may be the same.  In the instance they are the same i would like to use an HTML checkbox, that when checked would auto populate the "OWNER" side of the form, by what the "COMPANY side of the form has.
Not even sure if its possible, might be the same as if "Shipping" and "Billing" information is the same perhaps that is using Javascript.

Thanks in advance
Chris
Link to comment
https://forums.phpfreaks.com/topic/19297-checkbox-autofill/
Share on other sites

If you want to populate the billing address with shipping address when the user clicks the box then you need javascript.

If you just want to indicate they are the same then it's php.
[code]
if (isset($_POST['cb_sameaddress'])) {
    $billing = $shipping;
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/19297-checkbox-autofill/#findComment-83752
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.