Skip to main content
Participant
April 29, 2019
Question

Have a form field (text box) mirror the text/data entered in another form field. (i.e. user enters column names for table on first page, then column names are displayed later in document)

  • April 29, 2019
  • 2 replies
  • 3998 views

So in a very low-level kind of way, I am trying to mimic an excel file. I want the first page of the pdf document to act as the "master data" sheet and the preceding pages will grab text and numbers from that page. I have never worked with javascripts before so the syntax is very confusing. I understand that you can create a calcuation under the "Calcuate" tab (under properties of a form field), but it only deals with numbers. Any help would be great!

This topic has been closed for replies.

2 replies

Participant
April 29, 2019

I figured that there was an easy way to do it. I do not doubt that there are a ton of capabilities of the calcuate tab, I just don't know javascript really well

try67
Community Expert
Community Expert
April 29, 2019

Just give both fields the same name and they'll automatically have the same value.

And it's not true that a calculation script can only deal with numbers.

Participant
April 29, 2019

Is there a way to edit one form field and have the other locked if they have the same name?

try67
Community Expert
Community Expert
April 29, 2019

No. If you want the other field to be read-only then they need to have unique names, in which case you will need to use a calculation script. Let's say the first field is called "A" and the second "B".

You can set B as read-only and use this code as its custom calculation script:

event.value = this.getField("A").valueAsString;