Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Insert Image via URL

Jakub Synowiec
Kilo Expert

Hey,

I want to insert an image into a form with an URL and not included Image field type.
How do I do that?
I used HTML box and marked is as read only, it works but it shows two buttons ( - and + ), remove and add lines to the script area.
I tried to get rid of this buttons using System UI -> Field Styles, but I am not able to stylize anything outside the context of the field box.

Example attached below.

Thanks for any help!

1 ACCEPTED SOLUTION

Alright, I've dig a little bit deeper in this situation.
Basically what I did is access the plain HTML from a client script and removed the <div> element that held these two buttons.
I did it within onLoad client script.
JS code:
g_form.getFormElement("u_html").elements["x_58872_needit_needit.u_html"].parentElement.firstChild.innerHTML = "";



parentElement on the u_html element is the container for the context of HTML field. Therefore it holds both "+" and "-" buttons and the HTML view.
The firstElement is the <div> element containing these buttons, so if I replace them with an empty string, the buttons dissapear.
End result:




find_real_file.png


View solution in original post

5 REPLIES 5

Alright, I've dig a little bit deeper in this situation.
Basically what I did is access the plain HTML from a client script and removed the <div> element that held these two buttons.
I did it within onLoad client script.
JS code:
g_form.getFormElement("u_html").elements["x_58872_needit_needit.u_html"].parentElement.firstChild.innerHTML = "";



parentElement on the u_html element is the container for the context of HTML field. Therefore it holds both "+" and "-" buttons and the HTML view.
The firstElement is the <div> element containing these buttons, so if I replace them with an empty string, the buttons dissapear.
End result:




find_real_file.png