The Zurich release has arrived! Interested in new features and functionalities? Click here for more

how to display alert message when filed value changes

Govardhan
Kilo Contributor

hi All

i am trying to display an alert message in incident form ,i have configuration item filed when user selects "redbird"option in configuration item filed .i have to pop up a alert message ..saying that "you have selected "redbird as your choice".can any one help ...?

12 REPLIES 12

thanq so much for the reply ,i want an alert message to be displayed when a specific option is selected not for all message.


requirement is:


i want alert message when specfic option is selected


for example :there are 3 options:A,B,C


if i select A then only i should get the alert message.if i select B or C i dont want alert message


harishdasari
Tera Guru

Hi Govardhan,



You can write a simple client script for this.


var x = g_form.getValue('cmdb_ci', 'redbird')


if(x == true)


{


alert('you have selected redbird as your configuration item');


}



thanks


thanq ,this code is not working i have tried it in on change client script can you let where i am doing wrong



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


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


          return;


    }




    //Type appropriate comment here, and begin script below


  var x = g_form.getValue('cmdb_ci', '*ASSET-IBM');


if(x == true)


{


alert('you have selected redbird as your configuration item');


}


}




requirement is:


i want alert message when specfic option is selected


for example :there are 3 options:A,B,C


if i select A then only i should get the alert message.if i select B or C i dont want alert message


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


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


          return;


    }




    //Type appropriate comment here, and begin script below


    var ci=g_form.getDisplayBox('cmdb_ci').value;



if (ci == "redbird")


{


  alert("Selected CI is= "+ci);


}


}


shilpiharitwal
Mega Expert

Hello Govardhan,



You can create onChange Client Script for your particluar field/variable.



For Example: find_real_file.png



Hope it help you



Regards,


Shilpi Sharma