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

1st precedence out of two text boxes.

Participant ,
Feb 09, 2025 Feb 09, 2025

Good Day Experts, 

         My issue today is that I have two text boxes I need to reflect into one text box based on precedents. If my first text box has an entry, I would like it to display the first text box. But if there is an entry in the second text box, I would like it to display what is in the second text box. Is this possible?

 

TOPICS
Create PDFs , PDF forms
174
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 ,
Feb 09, 2025 Feb 09, 2025
LATEST

You want to show value in 3rd field?

You could use this as custom calculation script of 3rd field (change "Text1" and "Text2" to your actual field names of first and second 'text boxes'):

var t1 = this.getField("Text1").valueAsString;
var t2 = this.getField("Text2").valueAsString;

if(t2 !== "")
 event.value = t2;
else if(t1 !== "")
 event.value = t1;
else
 event.value = "";

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 ,
Feb 09, 2025 Feb 09, 2025

Enter the following custom validation script in the first text box:

this.getField("SecondTextBox").value=event.value;

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 ,
Feb 09, 2025 Feb 09, 2025
LATEST

You want to show value in 3rd field?

You could use this as custom calculation script of 3rd field (change "Text1" and "Text2" to your actual field names of first and second 'text boxes'):

var t1 = this.getField("Text1").valueAsString;
var t2 = this.getField("Text2").valueAsString;

if(t2 !== "")
 event.value = t2;
else if(t1 !== "")
 event.value = t1;
else
 event.value = "";
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