Skip to main content
nigels9669949
Participant
Feb 14, 2025 9:17 PM UTC
Answered

Help with auto populating a field based on another text field.

Hi, I need help with a pdf form. Is there a way to auto populate a field based on another field? i.e I have a dropdown field called 'Client Name', what I would like to do (if possible) is to auto populate a 'Client Address' field based on the 'Client Name' field. Is this possible?

PDF Automation Station
Community Expert
Feb 14, 2025 9:32 PM UTC

Enter client addresses as the export values of the client's names in the dropdown and then enter the following custom calculation script in the Address field:

event.value=this.getField("Client Name").value;

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts-eb5

https://pdfautomationstation.substack.com/p/another-method-for-calculation-vs

 

7 replies

PDF Automation Station
Community Expert
Community Expert
Feb 14, 2025 9:32 PM UTC

Enter client addresses as the export values of the client's names in the dropdown and then enter the following custom calculation script in the Address field:

event.value=this.getField("Client Name").value;

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts-eb5

https://pdfautomationstation.substack.com/p/another-method-for-calculation-vs

 

Translate
nigels9669949
Participant
Feb 15, 2025 12:27 AM UTC

Outstanding! That worked a treat. Thanks so much ' PDF Automation Station'.

 

One other question I now have that I hope you can help with.

From time to time I will have a new client (one that won't be in my "Client Name" dropdown list), so I have allowed this field to be able to enter text manually. What I can;t figure out though is how do I enable the "Client Address" field to accept manual text input? Hope that makes sense.  Is there a way to do this (use a custom calculation and have manual text entry in a field).

 

Translate
PDF Automation Station
Community Expert
Community Expert
Feb 15, 2025 12:51 AM UTC

Change the script to this:

if(event.source && event.source.name=="Client Name")
{event.value=this.getField("Client Name").value;}

Translate