How to make a single option readonly of multichoice variable on catalog form

Datta Pisal1
Tera Contributor

Hi All,

I have a multiple-choice variable  company with the options hp, dell. lenovo, asus. and another variable called new company that is a checkbox. requirement is if i select the checkbox called new company then the variable option hp should be read-only and other should be editable. how to achieve that i am trying with the below onchange client script but it is not working, please help.

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
 
        return;
 
 
    }
 
    var newComp = g_form.getValue('new_company');
    
    if (newComp == 'true') {
        
            // g_form.setDisplay('service', 'hp', false);   //not working
            //g_form.removeOption('service', 'hp');  //not working
            //g_form.setDisabled('service','hp','true');           //not working
            //g_form.setReadOnly('service','hp', 'true');      //not working
            // g_form.setVisible('service','hp','false');        //not working
 
        }
    }
 

Regards,

0 REPLIES 0