- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 04:34 AM
Hi there,
I have a requirement where I want to add a red asterisk to a label variable on a CI form to indicate that one of the checkboxes underneath it must be selected.
I currently have this script from SNC guru that I am trying to implement but it is not working.
function onLoad(){
try{
mandatoryLabelName = 'choice_of_sauce';
$('status.' + g_form.getControl(mandatoryLabelName).id).show();
}catch(e){}
}
Any help would be appreciated.
Kind regards,
G
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 05:54 AM
If these are variables on a Catalog Item, first add the label, choose no other setting.
Then add your checkboxes with an order to where they appear following each other right under the label variable.
In the first checkbox that appears after the label, check the "selection required" / "mandatory" box in the top-right corner of the variable settings. It will look like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 05:33 AM
I'm not sure if that script still works in recent releases, but since it's using DOM manipulation, make sure the Isolate script box is unchecked, and this would only work in the native UI, not Service Portal/Employee Center/...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 02:32 AM
Hi @Brad Bowman
Thank you so much for the insight. Is there a simpler way to just add a red asterisk then? I just want to add a visual indicator that the following checkboxes are mandatory, but the task is becoming much more complicated that I anticipated.
Kind regards,
G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 05:54 AM
If these are variables on a Catalog Item, first add the label, choose no other setting.
Then add your checkboxes with an order to where they appear following each other right under the label variable.
In the first checkbox that appears after the label, check the "selection required" / "mandatory" box in the top-right corner of the variable settings. It will look like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 06:17 AM