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

Change text field direction by javascript

New Here ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

Hello everyone , 

I was trying to use javascript for hiding and showing few fields and it works very well , but at the same time i tried to add a syntax to change the text direction but it didn't work !

 

Any one can help ? 

 

This is my code : 

if ( event.target.isBoxChecked(0)) {
    this.getField("Date").display = display.visible;
    this.getField("Text-1").display = display.visible;
    this.getField("Text-2").display = display.visible;
    this.getField("Name").display = display.visible;
    this.getField("Date-a").display = display.hidden;
    this.getField("Text-4").display = display.hidden;
    this.getField("Name-a").display = display.hidden;
} else {
    this.getField("Date").display = display.hidden;
    this.getField("Text-1").display = display.hidden;
    this.getField("Text-2").display = display.hidden;
    this.getField("Name").display = display.hidden;
    this.getField("Date-a").display = display.visible;
    this.getField("Text-4").display = display.visible;
    this.getField("Name-a").display = display.visible;
    this.getField("Text").direction = rtl;
}



 

TOPICS
Acrobat SDK and JavaScript

Views

217

Translate

Translate

Report

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 ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

Text direction (RTL/LTR) can't be set using a script. You can only set the text alignment, as either "center", "right" or "left".

Votes

Translate

Translate

Report

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
New Here ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

Thank you for your reply .

Do you Just through the text box options ? or by using a javascript ?! 

Votes

Translate

Translate

Report

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 ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

I don't follow. Do you want to change the alignment of the text in the field? Why not simply do it manually?

Does the alignment need to change?

Votes

Translate

Translate

Report

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
New Here ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

I did it now by adding a second text box with different text direction in the same place and added a function to show each one on a checkbox click .. 

i think it is good now .. 

 

One more thing , is it possible to show / hide an image in the same way using a checkbox ? 

Votes

Translate

Translate

Report

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 ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

You can do it directly if the image is the icon of a button field, or indirectly if the image is static then you can place a (read-only) field on top of it with a white fill color and show that field when you want to hide the image, and vice versa.

Votes

Translate

Translate

Report

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
New Here ,
Jun 14, 2024 Jun 14, 2024

Copy link to clipboard

Copied

LATEST

I will try and see .. 

Thank you so much

Votes

Translate

Translate

Report

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