how to do variable editor read only

keerthilatha
Tera Expert

I have a requirement to make the variables under Variable Editor Read-Only once an INTAKE is generated (from a submission of a Service Catalog). find_real_file.png

function onLoad() {

var template = g_form.getValue('u_template');

if (template != "28c64a0837f1cf00548b53b543990efd"){

var sections = g_form.getSections();

sections[2].style.display = 'none';

sections[2].style.display = 'none';

//To do variable editor read only

$(variable_map).select("item").each(function (elmt){

alert('hi');

try {

alert('qname453467568');

g_form.setDisabled('variables.' + elmt.getAttribute('qname'),true);

alert('qname');

} catch (err) {

}

});

//

}

}

11 REPLIES 11

Hi Avinash, Its not working please suggest me


It is not working, so i tried this, it is working now but, list collecter and check boxes are still editable, please let me know how to do read only for check box and list collecter



function onLoad(){


    try{


          //Get the 'Variables' section


          var ve = $('variable_map').up('table');


          //Disable all elements within with a class of 'cat_item_option'


          ve.select('.cat_item_option', '.slushselectmtm', '.questionsetreference').each(function(elmt){


                elmt.disabled = true;


          });


          //Remove any reference or calendar icons


          ve.select('img[src*=reference_list.gifx]', 'img[src*=small_calendar.gifx]').each(function(img){


                img.hide();


          });


          //Hide list collector icons


          ve.select('img[src*=arrow]').each(function(img){


                img.up('table').hide();


          });


    }


    catch(e){}


}