Skip to main content
Participating Frequently
May 6, 2024
Question

adobe acrobat form texbox value direction

  • May 6, 2024
  • 2 replies
  • 1990 views

I need a script to change the textbox value direction to right to left or left to right as the language in the  dropdown list i used the script below and the alignment worked useful but the direction is not working:

// Get the language from a dropdown or text field
var language = this.getField("lang").value;

// Get the text field
var textField = this.getField("Textbox");

// Set the direction based on the language
if (language === "ARABIC") {
textField.alignment = "right";
textField.direction = "rtl"; // right-to-left
} else if (language === "ENGLISH") {
textField.alignment = "left";
textField.direction = "ltr"; // left-to-right
}

 

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
May 6, 2024

Use two fields with different directions and show/hide the fields in the script.

Participating Frequently
May 6, 2024

Not working

Bernd Alheit
Community Expert
Community Expert
May 6, 2024

Form text fields doesn't have a property direction.

try67
Community Expert
Community Expert
May 6, 2024

They do, actually, but it can't be set using a script, only manually.

If your application has the RTL options enabled (under Preferences - Language) then you can set a field's direction as Right-to-Left or Left-to-Right, via its Properties, under the Appearance tab:

 

 

 

 

 

 

Participating Frequently
May 6, 2024

I make this form for other users and I will lock any edits in the form so I need it in javascript