- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 07:19 AM
I want to add a checkbox for each item, which only one can be selected (the other will gray out).
Here is what I have in mind
If I select the first item, the second checkbox should be gray out vice versa. I've looked everywhere, but couldn't find any solution, if anyone have any guidance or alternatives I would be greatly appreciate it!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 01:09 PM
function onLoad() {
var mrvs = g_service_catalog.parent.getValue('default_user_mrvs'); //internal MRVS name
if (mrvs.length > 2) { //native UI returns [] for empty MRVS value whichc causes parsing error
var obj = JSON.parse(mrvs);
for (var i=0; i<obj.length; i++) { //loop through the existing MRVS rows
if (obj[i].default_user == 'true') { //mrvs checkbox variable name
g_form.setReadOnly('default_user', true);
}
}
}
if (g_form.getValue('default_user') == 'true') {
g_form.setReadOnly('default_user', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 01:09 PM
function onLoad() {
var mrvs = g_service_catalog.parent.getValue('default_user_mrvs'); //internal MRVS name
if (mrvs.length > 2) { //native UI returns [] for empty MRVS value whichc causes parsing error
var obj = JSON.parse(mrvs);
for (var i=0; i<obj.length; i++) { //loop through the existing MRVS rows
if (obj[i].default_user == 'true') { //mrvs checkbox variable name
g_form.setReadOnly('default_user', true);
}
}
}
if (g_form.getValue('default_user') == 'true') {
g_form.setReadOnly('default_user', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2024 08:48 AM
This is it! Thank you Brad!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2024 09:59 AM
Quick question Brad, even though it's read only but when I select the Read-Only checkbox it still make it true on ServicePortal. Is there a known error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2024 10:45 AM
I am seeing the same in my Washingtondc patch 3 hotfix 1 PDI in Service Portal only. If this isn't a known error, it should be. Open a case with ServiceNow in the HI portal.