- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 07:17 AM
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!
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 07:53 AM
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2017 06:23 AM
Hi Jakub,
Can you explain it in more detail?
Also where is the screenshot.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2017 06:21 AM
bawiskar I was pretty sure the screenshot was attached the first time.
This is what I have so far. Pay attention to the Image labeled field on the right. It's a html page with read-only setting. You can see these '-' and '+' signs at the same level where the Image label is.
The W3 is the image I inserted via html and the red background is the CSS style that I implemented using System UI -> Field Styles.
Once again, I want to have an image field, using URL and not uploading a file to ServiceNow DB.
If there is any better way of doing it instead of HTML field, I'd be glad to know it!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 02:17 AM
Hi Jakub,
As far as I know you can store image in images table and have that in image field and other way is html field.
I don't think any other way exist to achieve this apart from the above 2 approaches.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 06:07 AM
bawiskar
I appreciate your response, but you did not solve my problem. I want to have these "+" and "-" buttons removed from above the image.
I already know that you can insert image in these two ways, just neither of those satisfy my requirements.