내 커뮤니티 업적 표시줄을 확대합니다.

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

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

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 채택된 해결책 개

Avatar

정확한 답변 작성자:
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

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
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