Change styling of a field

SUMITHA S
Kilo Contributor

Hi,

   How to change fields styling in forms using client script?

1 ACCEPTED SOLUTION

Afrith Shariff
Tera Guru

Hi Sumitha,

Firstly create a variable using getControl() method using g_form object

after specify the style using js like you do normally do while performing DOM manipulations.

I have given the code below.

 

var a = g_form.getControl('number');
a.style = "background-color:blue;border-radius:50px;height:100px;";

View solution in original post

2 REPLIES 2

Afrith Shariff
Tera Guru

Hi Sumitha,

Firstly create a variable using getControl() method using g_form object

after specify the style using js like you do normally do while performing DOM manipulations.

I have given the code below.

 

var a = g_form.getControl('number');
a.style = "background-color:blue;border-radius:50px;height:100px;";

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you explain your detailed business requirement?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader