Skip to main content
Participant
June 14, 2024
Question

Change text field direction by javascript

  • June 14, 2024
  • 1 reply
  • 643 views

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;
}



 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 14, 2024

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

Participant
June 14, 2024

Thank you for your reply .

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

try67
Community Expert
Community Expert
June 14, 2024

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?