Copy Address Fields

Issues related to forms.
Post Reply
christrentrsa
 
 
Posts: 28
Joined: Tue Jun 02, 2020 10:04 am

Copy Address Fields

Post by christrentrsa »

Hi

Can someone help with with the following:

I have a new customer registration page and I would like to add a button where when the user clicks on the button, it will copy the billing address to shipping address.

I have tried to add onclick events to a button but I don't know where to add the custom scripts. Can someone suggest how I can accomplish this?
User avatar
Pablo
 
Posts: 23249
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Copy Address Fields

Post by Pablo »

There is no standard solution for this, because there is no way to do this 'visually'. So, this will require a custom script.

For example:
https://www.w3schools.com/howto/howto_j ... pboard.asp
User avatar
BaconFries
 
 
Posts: 5877
Joined: Thu Aug 16, 2007 7:32 pm

Re: Copy Address Fields

Post by BaconFries »

See the following with demo but in this you either select one or another radio button to copy the fields
https://www.plus2net.com/javascript_tut ... y-data.php
christrentrsa
 
 
Posts: 28
Joined: Tue Jun 02, 2020 10:04 am

Re: Copy Address Fields

Post by christrentrsa »

Thanks @BaconFries

This helped me a lot :D
Post Reply