Skip to main content
Participant
September 3, 2022
Question

How to set value of a PDF form field using values from other fields in the same PDF form

  • September 3, 2022
  • 1 reply
  • 252 views

I want to use the values from a "first name" and "last name" to populate another field called "full name" (with spaces between the two fields).

I found the below script, but my javaScript skills are lacking and I don't know how to add extra values:

event.target.value =
this.getField("first name").value;



I am seeking guidance on how to add more than one field. I would greatly appreciate your assistance.

 

FYI, this is the original post I credit the above script to.

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
September 3, 2022

Use this as 'Custom calculation script' of "full name" field:

var first = this.getField("first name").valueAsString;
var last = this.getField("last name").valueAsString;
if(first&&last)
event.value = first+" "+last;
else
event.value = "";