Skip to main content
nigels9669949
Participant
February 14, 2025
Answered

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

  • February 14, 2025
  • 1 reply
  • 734 views

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?

Correct answer PDF Automation Station

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

 

1 reply

PDF Automation Station
Community Expert
Community Expert
February 14, 2025

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

 

nigels9669949
Participant
February 15, 2025

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).

 

PDF Automation Station
Community Expert
Community Expert
February 15, 2025

Change the script to this:

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