Solved

Get confirmation message from user on static drop-down list change event issue

  • 24 October 2022
  • 6 replies
  • 22 views

Hello,

I'm trying to implement a "Get confirmation from user" action on a static drop-down list populated with three static values (empty value allowed). Whenever the user changes the DDL value, a confirmation message dialog shows to the user with "Ok" or "Cancel" options. When the user validates, everything works fine, but the issue is when I hit "Cancel". As the message dialog shows on "When View Control is Changed" event, the new value is set behind the message even before hitting "Ok", so even if I decide to hit "Cancel", it doesn't go back and keep the initial value, but it instead keeps the new one.

 

Has anyone faced this problem? Any help would be appreciated 🙂 

 

Thank you,

 

Amine

icon

Best answer by tbyrne777 7 November 2022, 14:10

View original

6 replies

Userlevel 5
Badge +13
Try using a hidden field to track what the original value of the dropdown was and only show the confirmation message if the new value is different than the original value.

It is exactly what I was trying to do, the only problem is that I can't figure out on which event to trigger the tracking of the old value. When I tried to implement it in my rule, it just takes the new value that has been selected on "When control is changed" event and never saves the previous one before the change.

Userlevel 5
Badge +13
When control is changed should be the right place - if the original value is empty, then set it to the current value. If the original value is not empty, then you can compare it to the new value. Please let me know if that makes sense.
Well, that's quite the same logic I want to implement, the issue is how to save the old value ? because whenever I use "Transfer Data" at "When control is changed" event, the value that it takes is the new one because it only does the transfer data after the event is triggered, which mean after the control value has been changed
Userlevel 5
Badge +13
Ok, so I'm thinking you have a hidden data field called "Original" and a dropdown control called "New". Both of them are empty when the form loads. When the dropdown changes, do a compare to see if "Original" != "New" and show the confirmation box. IF they cancel the confirmation box, set New = Original. If they OK the confirmation box, set Original = New
Thank you "tbyrne777", I did something like that, just faced few issues when implementing everything but now it's all working fine.

Reply