Trying to change background color of single line textfield in ServicePortal and unable to do thT

CharanKulukuri
Tera Contributor

I want to change the background color of single line text field for a catalog item on ServicePortal when user is trying to submit a form.

Basically it should work on an onChange of other field. the field I want to change is just a single line text and Presetted value in it. it will be visible based on the other field.

I tried Isolated script true and false and also tried g_form.setStyle and getControl nothing worked.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@CharanKulukuri 

on portal you can use DOM but DOM is not recommended

see this link and enhance it further

How to make text of Label type in Bold 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

iftekharmir
Tera Expert

Hi @CharanKulukuri ,
Please refer to the following link. It may help you understand how to apply styles to fields in Service Portal.
Make a variable type Label bold on Service portal 
If you found this useful mark it as helpful
Regards,
Iftekhar