• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

function to copy contents of one textbox to another when checkbox clicked

Liviathan

Platinum Member
I've seen this before, like when ordering online. Copies the contents of shipping to billing for example. Anyone have some sample code on how to do this.


Thanks
 
On the checkbox put this:

OnClick="document.(FORM_NAME).(FIELD_BILLING_NAME).value = document.(FORM_NAME).(FIELD_SHIPPING_NAME).value;"

NOTES:
----------------------------------------------------
(FIELD_BILLING_NAME) = name of the Billing field (Ex: [textarea cols="10" rows="4" name="[b]BILLING[/b]"][/textarea])
(FIELD_SHIPPING_NAME) = name of the Shipping field (Ex: [textarea cols="10" rows="4" name="[b]SHIPPING[/b]"][/textarea])
(FORM_NAME) = Name of the Form TAG (Ex: [form action="action.html" method="post" name="[b]FORM[/b]"])
----------------------------------------------------

Remember: Names of fields and forms are CASE SENSITIVE
 
couldn't get this to work.

say control one is txtPrimaryName and other one is txtTechName.

I want Tech to get the value from primary.
 
Back
Top