pop up message when selecting a specific item from the list collector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 05:02 AM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 11:54 AM
Just tweaked the script a little bit Here is your updated client script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if((newValue.toString().indexOf("8444356d6fc00200512f5e354b3ee426")>-1) &&(oldValue.toString().indexOf("8444356d6fc00200512f5e354b3ee426")==-1)){
alert('your message');
}
}
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 11:58 AM
when I changed the script to this , actually by selecting every item , after selecting that specific item , it shows the pop up message

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 12:25 PM
You might have to write an onsubmit client script for this. Some how oldValue id not pulling any values in onChange client script.
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 12:28 PM
Thank you so much ! I'll try that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 12:31 PM
Your onSubmit script will be:
if(g_form.getValue('your list collector variable name').toString().indexOf('8444356d6fc00200512f5e354b3ee426')>-1){
alert("your message");
}