For the Catalog form need to add the collapsible container on portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello Community,
Trying to make collapsible sections for catalog item, with display title is working on the native UI.
But on the portal is not not working. so created a variable set with container start with display title true & end along with one single line variable
And also created a client script with DOM Manipulation
But is not working, only till alert("hello5") is coming up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
As mentioned it's limitation in portal.
Please inform customer about this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@Ankur Bawiskar Thank for your response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Use below code it'll work
function onLoad() {
var fieldName = "requested_for1"; // variable from variable set
var $ = this.jQuery;
// Wait 2 seconds for portal HTML to render properly
setTimeout(function() {
var $fieldset = $("#sp_formfield_" + fieldName).closest("fieldset");
if ($fieldset.length === 0) {
console.warn("Fieldset not found yet, aborting collapsible setup.");
return;
}
var $row = $fieldset.children("div.row");
var $button = $(
"<button style='margin-right:10px;margin-bottom:2px;' class='btn btn-icon'>" +
"<i class='fa fa-minus fa-lg'></i>" +
"</button>"
);
// Prepend the button to the legend
$fieldset.children("legend").prepend($button);
// Toggle row visibility on button click
$button.click(function() {
$row.toggle();
$button.find("i").toggleClass("fa-plus fa-minus");
});
}, 2500); // 2.5 seconds delay
}
If my response helped, please mark it as correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @is_12 ,
The same question has asked in the past. you can follow the below link to create the collapse containers.
If my answer is helpful, please mark it as helpful and accept my solution.
Regards,
Raviteja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @raviteja1600,
From the above article only, I have implemented the same.
But still it is not working
