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

Align text field based on text entered in another field

Explorer ,
May 27, 2024 May 27, 2024

I'm wondering if this is possible.  I have two text fields - Text1 and Text2.  If text is entered into Text1, I would like Text2 to have an Alignment of Right.  If no text is entered into Text1, I would like Text2 to have an Alignment of Left.  Thanks for any help.

TOPICS
JavaScript , PDF , PDF forms
429
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
2 ACCEPTED SOLUTIONS
Community Expert ,
May 28, 2024 May 28, 2024

Place this script as a "Validation script" in Text1:

if (event.target.value === event.target.defaultValue) {this.getField("Text2").alignment = "left";}
else  {this.getField("Text2").alignment = "right";}

 


Acrobate du PDF, InDesigner et Photoshoptographe

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
Explorer ,
May 28, 2024 May 28, 2024
LATEST
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 ,
May 28, 2024 May 28, 2024

Place this script as a "Validation script" in Text1:

if (event.target.value === event.target.defaultValue) {this.getField("Text2").alignment = "left";}
else  {this.getField("Text2").alignment = "right";}

 


Acrobate du PDF, InDesigner et Photoshoptographe
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
Explorer ,
May 28, 2024 May 28, 2024
LATEST

Thank you!

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