How to add a red asterisk to a label variable on CI

gunishi
Tera Guru

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

1 ACCEPTED SOLUTION

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:

BradBowman_0-1696942360472.png

BradBowman_1-1696942360422.png

 

 

View solution in original post

5 REPLIES 5

Brad Bowman
Kilo Patron
Kilo Patron

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/...

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

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:

BradBowman_0-1696942360472.png

BradBowman_1-1696942360422.png

 

 

Hi @Brad Bowman  

 

Thank you so much, this has met my requirement!

 

Kind regards, 

G