Hello,
Sorry, I haven't down a detailed forum search yet; How can I have user-entered data from some fields duplicated or copied automatically to other data fields in the form when/if a user ticks a box. For example, all contact details for a seminar participant are entered, they then check one box, and the participant contact details are copied to equivalent fields in the 'To Be Invoiced' section of the form. Thanks.
Thanks for the reply Alec. I've only set up the static form with different fields, e.g., Student_Name, Student_Address, and Admin_Name, Admin_Address. If they complete the student details, they can if they wish click a checkbox which says Copy Student Details to Admin Details. Clicking this checkbox automatically copies user-entered data from the student name and address fields into the admin name and address fields. I haven't implemented any Javascript for the processing, but assume it will be a combination of an IF statement with GETFIELD statement. Are there are any similar examples of scripts out there I can adjust? Thanks again.
Here's what I use:
//Put this in the CustomFormat script for the 'ToBeInvoicedName' field(s) if (this.getField('SameInformation_Checkbox').value == 'Yes') {
// Change this field name to match the corresponding field name (e.g. ContactName for ToBeInvoicedName)
event.value = this.getField('ContactName').valueAsString
event.target.readonly = true
} else {
event.target.readonly = false
}
// Put this in the Custom Calculation script for the 'ToBeInvoiced' field(s)
event.value = event.value
Be sure to change the names to match your Checkbox and Fields. You will need to change the value in the 'getField' line to the name of the matching entry field (e.g. ContactName for ToBeInvoicedName; ContactAddress for ToBeInvoicedAddressed, etc.)
North America
Europe, Middle East and Africa
Asia Pacific