Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to combine text box and date field

Explorer ,
Dec 04, 2025 Dec 04, 2025

I have a text box (name) and date field (saledate).

 

My goal is to have Text1 say "E-Signed by JOHN SMITH December 4, 2025"

"E-Signed by (NAME) (SALEDATE)"

 

This is what I have so far, but I'm unsure how to bring the two fields into this.

symone_1736_0-1764874969959.png

 

I hope this makes sense. Thanks in advance!

 

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF , PDF forms
106
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 04, 2025 Dec 04, 2025
LATEST

Try this as custom calculation script of "Text1" field:

var name = this.getField("name").valueAsString;
var date = this.getField("saledate").valueAsString;

if(name && date){
 event.value = "E-Signed by "+name+" "+date;}
else
 event.value = "";

JavaScript is case-sensitive so make sure field names are correct because "name" and "NAME" is not the same.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2025 Dec 04, 2025
LATEST

Try this as custom calculation script of "Text1" field:

var name = this.getField("name").valueAsString;
var date = this.getField("saledate").valueAsString;

if(name && date){
 event.value = "E-Signed by "+name+" "+date;}
else
 event.value = "";

JavaScript is case-sensitive so make sure field names are correct because "name" and "NAME" is not the same.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines