Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Can we make yes/No type variable name Bold

Ajaychethi
Kilo Contributor
  • Can we make Yes/no type variable bold .Can any one help me with this.
5 REPLIES 5

Aditya_hublikar
Giga Sage

 Hello @Ajaychethi ,

 You can acheive this using catalog client script : onload 

 

function onLoad() {
 var element = g_form.getControl('bold_test');
// to set value bold 
    if (element) {
       
        element.style.fontWeight = 'bold';
    }
 
// to set label bold
    if (element) {
    var label = element.closest('.form-group').querySelector('label');

    if (label) {
        label.style.fontWeight = 'bold';
    }
}
}
Aditya_hublikar_0-1794559697387.png

Aditya_hublikar_1-1794559724503.png

 

 

If this helps you then mark it as helpful and accept as solution .

Regards,

Aditya

Ajaychethi
Kilo Contributor

Variable Label should become bold as i selected YES/NO type

 

Hello @Ajaychethi ,

 Means you have to set label bold on selection of particular value from selectbox ?

You can try onchange catalog client script :

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    var element = g_form.getControl('bold_test')
    if (element) {
        var label = element.closest('.form-group').querySelector('label');
        if (newValue == 'Yes') {


            if (label) {
                label.style.fontWeight = 'bold';
            }
        } else {
            if (label) {
                label.style.fontWeight = '400';
            }
        }
        //Type appropriate comment here, and begin script below

    }
}
 
Aditya_hublikar_0-1794569145662.png

 

If this helps you then mark it as helpful and accept as solution .

Hello @Ajaychethi ,

 

I hope you are doing well . Does my response helps you ? 

 

If my response helps you then mark it as helpful and accept as solution so it will help in future community Queries .

Regards,

Aditya