border around html field when read only

juan casas
Mega Expert

Hello experts,

When a html field becomes read-only, the border around it goes away.

 

I need a field that displays rich text, to display text and some images etc.

 

Right now I am using an HTML field but its not working, when I set the field to read-only, the border of the field goes away.

I try to embed a cell table but that did not work.

The field is on a form, not the portal.

I posted this before but I cant get the solutions to work cause I suck:

https://community.servicenow.com/community?id=community_question&sys_id=f8bb88acdb85d950b5d6e6be139619cb

https://community.servicenow.com/community?id=community_question&sys_id=4ddc3c87dbd5db00b61ff3231f9619ea

 

find_real_file.png

 

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hello @juan casas ,

i think you directly cant embed a table you need to use source code to write HTML for that 

see below 

click on source code button highlighted 

find_real_file.png

then write your HTML code and it will work .(see the output of your name above)

find_real_file.png

 

And it think its the OOB behaviour where the border goes away when you make it read only coz iot should not allow any one to edit 

Hope this helps 

 

PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

View solution in original post

2 REPLIES 2

Mohith Devatte
Tera Sage
Tera Sage

Hello @juan casas ,

i think you directly cant embed a table you need to use source code to write HTML for that 

see below 

click on source code button highlighted 

find_real_file.png

then write your HTML code and it will work .(see the output of your name above)

find_real_file.png

 

And it think its the OOB behaviour where the border goes away when you make it read only coz iot should not allow any one to edit 

Hope this helps 

 

PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

SumanthDosapati
Mega Sage
Mega Sage

Hi Juan,

That is expected OOB behaviour that border goes off when read only.

Only option is, you create a border around the text inside the html field so that it will be present when readonly.

You can add border yourself as a table as suggested by using table or color etc.

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth