Read Only Fields displaying black

RobDoyle
Giga Guru

I am having an issue atm where I want certain fields to be read only but on the service portal it puts a black background in the field 

It is doing this for me as admin so i don't believe it is an ACL causing it as it should bypass them as admin

This form is from a catalog item all the variables are single line text fields that are prepopulated based off the name entered.

I can only assume it is a style or theme possible causing it.

It is only on the portal end the back end fields are fine once submitted.

2 ACCEPTED SOLUTIONS

@RobDoyle 

open your portal record and check the theme

AnkurBawiskar_0-1745406480868.png

 

Search in the css variables if someone did the change recently by comparing the versions

AnkurBawiskar_1-1745406531324.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

RobDoyle
Giga Guru

@Ankur Bawiskar 

Thank you for your assistance 

I have managed to fix this by 

RobDoyle_0-1745481741257.png

Finding the theme as recommended 


Then creating a new Style Sheet with the below script


input[readonly] {
background-color: #f5f5f5 !important;
color: #000 !important;
border: 1px solid #ccc !important;
box-shadow: none !important;
outline: none !important;
}

 

And adding that to the theme 

This now shows the fields like this 

RobDoyle_1-1745481899420.png

So no longer have the issue with it displaying as black

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@RobDoyle 

is this happening for all catalog items where the variables become readonly?

If yes then it's due to theme or css

Any client script is doing this for your catalog item if this is not happening for other items?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar 
Yes it is happening for all catalog items after testing on a different one.

There is no client scripts running on any of the items affected 

I am just trying to work out what theme's / css is affecting it but i never built our portal so digging round blindly 

@RobDoyle 

open your portal record and check the theme

AnkurBawiskar_0-1745406480868.png

 

Search in the css variables if someone did the change recently by comparing the versions

AnkurBawiskar_1-1745406531324.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

RobDoyle
Giga Guru

@Ankur Bawiskar 

Thank you for your assistance 

I have managed to fix this by 

RobDoyle_0-1745481741257.png

Finding the theme as recommended 


Then creating a new Style Sheet with the below script


input[readonly] {
background-color: #f5f5f5 !important;
color: #000 !important;
border: 1px solid #ccc !important;
box-shadow: none !important;
outline: none !important;
}

 

And adding that to the theme 

This now shows the fields like this 

RobDoyle_1-1745481899420.png

So no longer have the issue with it displaying as black