Copy link to clipboard
Copied
Hi all,
I'm looking for an answer if something I'm proposing is possible using javascript (or something else entirely). I'm looking to create a PDF form but have 'First name' and 'Surname' fields on the cover, but within the document variable text fields that populate with the 'First name' on other pages. Is this possible, or would this not be javascript at all?
So for example:
Page 1
First name: Becky
Surname: Smith
Page 3
Running header: "<Becky>'s workbook"
Page 5
Body copy: "<Becky>, here is your chance to answer some questions."
Any advice greatly appreciated!
For that you will need to use fields with unique names and a simple script to copy the value other.
For example, if the editable field is called "Name" and the copy is called "NameCopy", use the following code as the custom calculation script of the latter:
event.value = this.getField("Name").valueAsString;
Then you can set the copy field to be read-only and then user won't be able to edit it.
Note, though, that the text in this field will not "re-flow" the rest of the sentence. To do that the entir
...Copy link to clipboard
Copied
You can copy and paste the fields from the first page to the other pages, and they'll all have the same value automatically.
Copy link to clipboard
Copied
Thanks for the speedy response. That does work to some degree, however this means the form field is visible on the populated areas. I'm looking for these to look like part of the same sentence and not an editable area, as such.
Is there a way around that?
Copy link to clipboard
Copied
For that you will need to use fields with unique names and a simple script to copy the value other.
For example, if the editable field is called "Name" and the copy is called "NameCopy", use the following code as the custom calculation script of the latter:
event.value = this.getField("Name").valueAsString;
Then you can set the copy field to be read-only and then user won't be able to edit it.
Note, though, that the text in this field will not "re-flow" the rest of the sentence. To do that the entire text needs to be a part of the same field.
Copy link to clipboard
Copied
Wow! Thank you so much, that really does exactly what I needed!
try67 wrote
Note, though, that the text in this field will not "re-flow" the rest of the sentence. To do that the entire text needs to be a part of the same field.
How would I include the rest of the text into the field as well?
Copy link to clipboard
Copied
Use something like this:
event.value = this.getField("Name").valueAsString + " other text ";
Copy link to clipboard
Copied
Amazing guys! Thank you both very much!
Copy link to clipboard
Copied
Use a field for the whole header and a field for the whole body.