Skip to main content
Participant
Jun 14, 2024 8:19 PM UTC
Question

Change text field direction by javascript

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 is closed to new replies. Start a new post to keep the conversation going.

6 replies

try67
Community Expert
Community Expert
Jun 14, 2024 8:21 PM UTC

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

Translate
Participant
Jun 14, 2024 8:35 PM UTC

Thank you for your reply .

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

Translate
try67
Community Expert
Community Expert
Jun 14, 2024 9:23 PM UTC

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?

Translate