how to show the warning message via catalog client script

ankit_sharma487
Kilo Guru

i have to show

         

Warning Message: if request=='Remove Access'
This will revoke all your access from the group and group associated   access rights
Click OK to continue or Cancel to stay on the page

i wrote

function onChange(control, oldValue, newValue, isLoading) {

    if (isLoading || newValue == '') {

          return;

    }

var checkREMOVE=g_form.getValue('request_type');

  if(checkREMOVE=="remove")

    {

    g_form.addErrorMessage("okokok"); //here i have to show the message with oK and Cancel buttons

    }

  //Type appropriate comment here, and begin script below

   

}

1 ACCEPTED SOLUTION
6 REPLIES 6

Shishir Srivast
Mega Sage

Please use :



function onChange(control, oldValue, newValue, isLoading) {


    if (isLoading || newValue == '') {


          return;


    }


var checkREMOVE=g_form.getValue('request_type');


  if(checkREMOVE=="remove")


    {


    //g_form.addErrorMessage("okokok"); //here i have to show the message with oK and Cancel buttons


alert("okokok");


    }


Kalaiarasan Pus
Giga Sage

Thanks it solved my issues in almost no time


Shishir Srivast
Mega Sage

Also, please note that addErrorMessage function is a server side function which you can use in Business Rule or Script Include.



Please find more details here: GlideSystem - ServiceNow Wiki