Add mandatory red asterisk to the Label for checkbox

vai
Kilo Contributor

I have a group of individual checkbox variables, i want to add a red asterisk to the Label of the checkbox list..

 

I created a UI policy with conditions checking if the checkbox is not checked... In the advanced view i added the below script..

 

  var mandatoryLabel = 'What Accessories are needed?';

    //Get all of the LABEL tag elements and check for a matching label

    $$('label').each(function(labels) {

          if(labels.innerHTML.indexOf(mandatoryLabel) > -1){

                //Set the 'mandatory' class name for the label element

  labels.previousSibling.className = 'mandatory required-marker label_description';

          }

    });

 

I see error as Labels is undefined.

1 ACCEPTED SOLUTION

Right click on the variable and then check the mandatory field from dictionary ovverride.

DONT forget to hit LIKE and HELPFUL if found useful.

View solution in original post

4 REPLIES 4

nayanawadhiya1
Kilo Sage

Hello,

 

Using Client Script you can make checkbox as Mandatory.

Refer this link -

Make Checkbox Variables Mandatory

saurav1
Kilo Expert

Hello,

In the variable description you will find a selection required option check and it will be a mandatory field.

Please HIT LIKE or HELPFUL if found reasonable .

vai
Kilo Contributor

which variable, on the label ?

Right click on the variable and then check the mandatory field from dictionary ovverride.

DONT forget to hit LIKE and HELPFUL if found useful.