
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 11:12 PM
HI,
Is there anyway to hide the containers based on the choice option selected.
I know it would work using UI policy, but I also tried the same via Catalog client script ('on change'), which didn't help.
Can anyone of you help me out?
#Snippet I used
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var num=g_form.getValue('firewall_no_of_rules');
if(num==2)
{
g_form.setVisible('firewall_rules2',true);
}
else if(num==3)
{
g_form.setVisible('firewall_rules3',true);
}
Thanks
Sailesh
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 04:57 PM
Did you ever find an answer for this? I am trying something similar.
I am using this code, and it is not working...
function onLoad() {
var Type = g_form.getValue('variables.BI_ReqType');
alert(Type);
if (Type !== 'Modify Report Distribution')
try {
$("container_31646219dbf317405b9add0b5e9619bc").hide();
} catch(error) {}
if (Type !== 'Create Report')
try {
$("container_12f46a19dbf317405b9add0b5e96191e").hide();
} catch(error) {}
if (Type !== 'Modify Report')
try {
$("container_1a53aa95dbf317405b9add0b5e9619a1").hide();
} catch(error) {}
if (Type !== 'Schedule Report')
try {
$("container_fb46ee19dbf317405b9add0b5e96198d").hide();
} catch(error) {}
if (Type !== 'Publish Report')
try {
$("container_08196e99dbf317405b9add0b5e961982").hide();
} catch(error) {}
if (Type !== 'New Data Request')
try {
$("container_5d41fe11db3717405b9add0b5e961951").hide();
} catch(error) {}
if (Type !== 'Data/Report Question')
try {
$("container_0c42b611db3717405b9add0b5e96197d").hide();
} catch(error) {}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 11:46 PM
Hello Ssailesh
Inspect the element by using browser's developer options and get the 'id' attribute of the container. And then use the following JavaScript code to hide/show the container.
Code: document.getElementById("inspected id comes here").style.display = "none";
document.getElementById("inspected id comes here").style.display = "block";
Thanks
Abhijeet Upadhyay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2018 02:10 AM
Hi Abhijeet,
It's helpful and working.
But could you also help me the same way on Service Portal as well.
I know that Container variables doesn't work on SP! just to know if you have any way for this.
And,
Is it possible to hide the containers on load at the first place and make visible only when the choice is selected. I think my "on change" script is not working at this point.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 05:51 AM
Hi Abhijeet,
This is perfect! It worked.
But it is not working on Service Portal. Do you have a solution for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2018 12:33 AM
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke