Fetching dialog field value in JS | Community
Skip to main content
Level 2
August 14, 2020
Solved

Fetching dialog field value in JS

  • August 14, 2020
  • 3 replies
  • 4602 views

Hi All,

 

I have created custom component with dialog with one text field. I am trying to fetch text field value in js which gets called on clicking of validate button to validate the entered text field value by author. But I am unable to fetch dialog field value. 

I have tried these:

 

dialog.getField("property name").getValue();

properties.get("property name","");

 

But it is not working. Nothing observed in error logs.

 

Any help to resolve this will be appreciated.

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 vanegi

Check this https://stackoverflow.com/questions/45637228/to-fetch-dialog-property-value-selected-by-an-author-aem-in-javascript

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/fetch-dialog-property-value-in-js-in-aem/td-p/214099

 

See sample snippets

$(document).on("selected", ".dropdownselect", function(e) {
    //iterate over e and get element select value
});

$(element).data("select").getValue();

 

Thanks!

 

 

3 replies

vanegi
Adobe Employee
vanegiAdobe EmployeeAccepted solution
Adobe Employee
August 14, 2020

Check this https://stackoverflow.com/questions/45637228/to-fetch-dialog-property-value-selected-by-an-author-aem-in-javascript

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/fetch-dialog-property-value-in-js-in-aem/td-p/214099

 

See sample snippets

$(document).on("selected", ".dropdownselect", function(e) {
    //iterate over e and get element select value
});

$(element).data("select").getValue();

 

Thanks!

 

 

Varun_Shakya
Community Advisor
Community Advisor
August 14, 2020
if you want to validate your textfield in touchUI dialog refer this:- https://aemfuel.blogspot.com/2018/06/validating-fields-in-touch-ui-dialog.html if textfield and validate button both present on page.. then textfield value can be picked up by class or id of that element on click function of validate button
Nikhil-Kumar
Community Advisor
Community Advisor
August 15, 2020

Hey,

The best and awesome way that I found to get any dialog data in JS using in Jquery is using Coral UI.
Using this you can get any single field or multifield data.
It's really fast and smooth.
Checkout Jquery on dialog values to fetch the dialog values in JS using Jquery.

You can reach out to me as well, I have done a lots of customization on Coral UI.
Happy Coding!!