Expandir la barra de logros de la comunidad.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.

RESUELTAS

AEM 6.3 - Coral Select List, How to get previously selected value on change event.

Avatar

Level 1

I have a progressive drop down in my dialog. My requirement is to get previously selected value on change event.

Basically, I want's to show confirmation box to the user only if he selected a different value. And if the user clicks on the cancel button, the previous value should be automatically selected.

Demo : Dropbox - Jun-28-2018 12-32-23.mp4 

1 solución aceptada

Avatar

Respuesta correcta de
Community Advisor

Hi,

You can do this by using jquery, below is the sample code snippet to get previous value  from dropdown

(function () {
  
var previous;

  $
("select").on('focus', function () {
  
// Store the current value on focus and on change
  previous
= this.value;
  
}).change(function() {
  
// Do something with the previous value after the change
  alert
(previous);

  
// Make sure the previous value is updated
  previous
= this.value;
  
});
})();

Thanks

Arun

Arun Patidar

AEM LinksLinkedIn

Ver la solución en mensaje original publicado

1 Respuesta

Avatar

Respuesta correcta de
Community Advisor

Hi,

You can do this by using jquery, below is the sample code snippet to get previous value  from dropdown

(function () {
  
var previous;

  $
("select").on('focus', function () {
  
// Store the current value on focus and on change
  previous
= this.value;
  
}).change(function() {
  
// Do something with the previous value after the change
  alert
(previous);

  
// Make sure the previous value is updated
  previous
= this.value;
  
});
})();

Thanks

Arun

Arun Patidar

AEM LinksLinkedIn