- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:12 AM - edited 10-13-2022 01:13 AM
I have 2 section on form
I want add 2 scrollbar in each section.
Is there any way to do this?
This is my form
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:18 AM
Hello,
You need to write a onload client script on the form with the below code:-
var sec_el = document.getElementById("991f88d20a00064127420bc37824d385");//Sys ID of the section.
if(sec_el){
sec_el.style.maxHeight = "100px"; //Update based on your need
sec_el.style.overflow = "scroll";
}
Also make sure the isolate script checkbox is false on client script as it is DOM manipulation:-
For more info look at the below post:-
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:38 AM
For me it works perfectly fine:-
Btw I see you are using scoped application that means you cannot use document in scoped app
So to make it work do the below :-
Create a system property in that scope named :- glide.script.block.client.globals
This will make the document work in client script event.
For more info check the ServiceNow article:-
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551586
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:18 AM
Hello,
You need to write a onload client script on the form with the below code:-
var sec_el = document.getElementById("991f88d20a00064127420bc37824d385");//Sys ID of the section.
if(sec_el){
sec_el.style.maxHeight = "100px"; //Update based on your need
sec_el.style.overflow = "scroll";
}
Also make sure the isolate script checkbox is false on client script as it is DOM manipulation:-
For more info look at the below post:-
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:26 AM - edited 10-13-2022 01:30 AM
Yes i tried write a onload on form but it doesn't work. It message error (TypeError: Cannot read properties of null (reading 'getElementById')).
It only works on incident table
I think this only works on global
My section form have sys_id is ccb9ec4997621110ed287f5e6253af20.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:38 AM
For me it works perfectly fine:-
Btw I see you are using scoped application that means you cannot use document in scoped app
So to make it work do the below :-
Create a system property in that scope named :- glide.script.block.client.globals
This will make the document work in client script event.
For more info check the ServiceNow article:-
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551586
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 01:52 AM
I tried create system properties. But it doesn't works
Is there any way to do this?