AEMaaCs : How to capture onchange value of pathfiled of dialog | Community
Skip to main content
Level 4
August 4, 2022
Solved

AEMaaCs : How to capture onchange value of pathfiled of dialog

  • August 4, 2022
  • 2 replies
  • 820 views

Hi,

 

I have a pathfiled field where I need to select path of an image.

Below that is AltText filed. So whenever path of the image is selected in pathfiled I need to update AltTxt filed from metadata description of that image.

 

So my logic is to target onchange value of pathfield make an ajax call to metadata and update altTxt filed.

But I am not able to capture on change value of pathfiled . 

I have added granite class : pathfield__asset--selector to pathfiled.

So my event is like below.

1> 

$(document).on("change", ".pathfield__asset--selector", function () {
const val = $(this).val();
});

Note : Above code is not working because pathfiled input is not having any value attribute looks like value is getting from coral-tag as shown below.

2> Henced tried with below code snippet.

$(document).on("change", ".pathfield__asset--selector coral-taglist coral-tag", function () {
const val = $(this).val();
});

Above code is also not working.

 

Please help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar
$(document).on("change", ".pathfield__asset--selector", function () {
const val = $(this).find('input').val();
});

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 4, 2022
$(document).on("change", ".pathfield__asset--selector", function () {
const val = $(this).find('input').val();
});
Arun Patidar
HeenaMadan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 4, 2022

Try this

 

$(document).on("change", ".pathfield__asset--selector", function () {
const val = $(this).find("input").val();
});