pop up message when selecting a specific item from the list collector

sonita
Giga Guru

I have a list collector , when selecting a specific item , a pop up message should be shown . I have an on-change client script to meet this requirement:

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

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

          return;

    }

  if(newValue=="8444356d6fc00200512f5e354b3ee426")

{

  alert('MY MESSAGE');

   

}

   

}

this code works , but the problem is when selecting other items , this message will pop up again! I need the pop up to happen only once! and when that specific item is selected!

14 REPLIES 14

syedfarhan
Kilo Sage

HI Soni,



You need to use this


g_form.clearValue('variable_name'); // your variable name.




Thanks


where should I use this? and by the 'variable_name' , do you mean my list collector?


Soni,



  Write an onChange client script on your list collector variable and add this script in there.



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


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


          return;


    }


if(newValue.toString().indexOf("8444356d6fc00200512f5e354b3ee426")>-1){


  alert('your message');


}


}



Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response


Thanks again for all your help. i have a question on this :


can we set this up in a way that once selected and it is located in the right bucket so it should show the pop up and that works fine, but when adding another item to it , it again shows the pop up and that's something I don't want . and with my code and your codes it still shows the pop up.