Skip to main content
pilotmitch
Participant
August 3, 2020
Answered

Set default value of PDF form field as the value of another field in the same PDF form

  • August 3, 2020
  • 1 reply
  • 10681 views

Does anyone know how to make the default value in a field be equal to another field.

For example if I had a field called "Name" and I wanted that field contents to be the Default value in a field called "Name2".  The idea is not having to input the value twice but leaving the possibility to change the value in field "Name2" "the default value" to another value if desired.

This topic has been closed for replies.
Correct answer ls_rbls

Custom calculation script.

 

Right-click on that field and select Properties from the context menu. Then go to the calculate tab.

 

See slide:

 

1 reply

ls_rbls
Community Expert
Community Expert
August 3, 2020

There's always many ways to achieve this with javascripting.

 

In  my case, this simple line of code worked for me:

 

 

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

 

 

Use the script as custom calculation script in field "Name".

pilotmitch
Participant
August 3, 2020

Where do I put that?  I was thinking in the Default Value under options but that doesn't seem to work

ls_rbls
Community Expert
Community Expert
August 3, 2020

It works!!!  You the MAN!!


Great! happy to help and kudos to my mentor Try67 who consistently helps me to become better at this.