Field styles in Form view

amaradiswamy
Kilo Sage

Hi All,

I have defined a style by using javascript:condition in the "Value field" of "Field Styles" to set the background color. It was working fine but the style is working only in the LIST view, when i open the form then the field on the form is normal and no background color was applied for that.

Please kindly advice on this?

Thanks & Regards,

swamy

16 REPLIES 16

Didn't know about this Paul - great recommendation


srinivasboppana
Kilo Expert

use onload client script.it will working.


get html object of the field and set color for that.



Ex: htmlobject.style.background="red";


vinothkumar
Tera Guru

Hi Swamy,



Have you got the solution for this. We are in Geneva..Styles are not working here, it was working fine in Eureka release, Can any one help me on this??



Do we need to go with client script, will the styles will not work here??



Value: javascript:current.caller_id.u_telecommuter==true && current.caller_id.vip==true&&current.caller_id.active==true;



Style: background-color:LightCoral


Maybe log a ticket with HI.


I'm pretty sure Service-now has a top level style on choice lists that you can't override via   Personalize Styles.


It has been like this since Fuji +



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

sravani21
Kilo Contributor

Hi Swamy


We were facing the same issue and came to know that, field styles apply on the form only if the field on which it is applied is disabled on the form. You can make your field non-editable if that is okay. and the field style would start working. Otherwise You need to use client scripts.



Thanks
Sravani