- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 11:47 AM
Hello,
I am trying to find the best way to hide seconds from a duration field that we have. I am using something from another community post I found earlier. I was advised by a member on my team to modify the attributes on the field. How can I do that through an attribute?
This is what I have to currently hide the seconds and it works, but there is a temporarily glimpse at the seconds field while the page is loading:
function onLoad() {
g_form.getElement('ni.pm_project.effortdur_sec').style.display='none';
}
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 12:02 PM
Absolutely highly NOT recommended, for instance refer to the following official article:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0692555
If I have answered your question, please mark my response as correct and helpful.
Thank you very much
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 11:52 AM
Hi,
using DOM manipulation is highly not recommended in the platform.
Anyway, there is no way to remove this temporary effect, it's the way it works onLoad client script with DOM manipulation, which I wouldn't do at all.
Hope this clarify your question.
If I have answered your question, please mark my response as correct and helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 11:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 12:02 PM
Absolutely highly NOT recommended, for instance refer to the following official article:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0692555
If I have answered your question, please mark my response as correct and helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 12:07 PM
function onLoad() {
addAfterPageLoadedEvent(function(){
g_form.getElement('ni.pm_project.effortdur_sec').style.display='none';
});
//Your rest of the onload script
}