how to make read only variables on requested item

rakhi1234
Kilo Contributor

currently iam using the below script for making read only of available all variables on my requested item but now i want writable few of variables depends upon some conditon .how can i proceed this scenario can you please explain.

function onLoad() {

  //Type appropriate comment here, and begin script below

if(g_user.hasRole("itil"))

{

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){}

}

}

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Rakesh,



Any update on this?


Can you mark answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader