Widget Server Script Adjust CSS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 10:49 AM
I am looking to hide and unhide a bit of text on a service portal widget. I have already placed the text in a span with an ID in the HTML and i have the CSS related visibility set. However I can't seem to find a way to effect this CSS with the server Script. I have already the logic setup to turn on and off this text but can't figure out how adjust this CSS.
----HTML-----------
<h4 class="panel-title">${Case Record {{::record.number}}} <span id="parent"><br/>(Parent Case)</span></h4>
------CSS-------------
#parent {
visibility: hidden;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 11:20 AM
Hello ewok,
I'm not quite sure of a way to directly change some CSS via a server script. Wouldn't have to be part of your client script? You may have to set up a client/server side call to get what you are looking for.
Cheers,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 11:29 AM
I am fine with putting my logic in the client script too. Initially that was my thought. However i haven't been able to figure out how to say hide or unhide id="parent" with a server or client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 12:53 PM
Hello ewok,
This link may help guide you: https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp
Cheers,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 02:37 PM
Thanks still no luck for me. I found some community posts that say that the DOM document.getElementById("myDIV"); isn't supported. However others mention it working. More sites seem to say it is unsupported.
https://serviceportal.io/docs/documentation/client_scripting.md
Unsupported client scripting globals
The following globals and APIs are unavailable in service portal client script:
- window
- document
- $
- jQuery
- $$
- $j
- angular
I will keep trying and update if i find a solution.