Is there a way to change text direction

DevKR
Tera Contributor

Hello. is there a way to change text direction from left to right 

to right to left?

i am using a right to left language...

6 REPLIES 6

Amit_Kirpane
Tera Contributor

Hi @DevKR ,

 

please check below script if it helps, its working fine for me.

 

function onLoad() {
    var myField = 'u_od'; //field value
    var ctrl = g_form.getDisplayBox(myField);

    if (!ctrl) {
        ctrl = g_form.getControl(myField);
    }
    console.log('Control:', ctrl);
   
    if (ctrl) {
        ctrl.style.textAlign = 'left';
    } else {
        console.error('Control not found for field:', myField);
    }
}

Alex Coope - SN
ServiceNow Employee
ServiceNow Employee

Please do not do this by code, because it is an unnecessary customisation. Please just set the "text direction" on the Language record, details can be found here,

Many thanks,
kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization