Popup when selecting repeating group item

I have a repeating group with 3 items that each correspond to a unique form. When the user selects a different rg item it resets the form inputs of the others. I would like a popup message to appear warning that the inputs will be reset when they choose a different rg element. If they choose OK, then the new rg item is selected, the data is reset, and the new form is shown. If they choose Cancel then the new rg item isn’t selected and nothing happens. Is this possible?

Have you tried this?

  1. add “Show popup” on RG item click
  2. in your popup element:
    2.1 if “yes” is clicked - reset inputs
    2.2 if “no” is clicked - hide popup