Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

unable to fetch dropdown value correctly

Avatar

Avatar
Validate 10
Level 2
Shaheena_Sheikh
Level 2

Like

1 like

Total Posts

87 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Give Back
Boost 1
Applaud 5
View profile

Avatar
Validate 10
Level 2
Shaheena_Sheikh
Level 2

Like

1 like

Total Posts

87 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Give Back
Boost 1
Applaud 5
View profile
Shaheena_Sheikh
Level 2

16-04-2021

I have a component in which i have a multifield item. In each multifield item i have separate containers. In of the containers i have a dropdown. I am trying to fetch the selected value of the dropdown, but i am only getting select as the value with the below code. Whereas if use this code in other components having multifield and dropdown directly as an item in the multifield then i am getting the correct value.

My component1-->Tab(Data)-->multifield item1-->container(list)-->container(button)-->dropdown (below code doesn't work).

My component2-->Tab(Data)-->multifield item1-->container(list)-->dropdown (below code works).

console.log("text.js");
(function ($, document, ns) {
$(document).on("dialog-ready", function() {
$(".coral3-Multifield-item").each(function( index ) {
let dropdown = $(this).find(".cq-dialog-dropdown-showhide-multi")[0].selectedItem.value;
console.log(ctaDropdown); //prints "select" all the time.

}) });
})(Granite.$, document, Granite.author);

below is the dropdown property for both comp1 and comp2

Screenshot (192).png

Do I need modify my loop because of the extra container/nesting of container?

View Entire Topic

Avatar

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

404 likes

Total Posts

502 posts

Correct Reply

137 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

404 likes

Total Posts

502 posts

Correct Reply

137 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile
asutosh_jena
Level 10

16-04-2021

Hi @Shaheena_Sheikh 

 

Can you please put the dialog structure here for the below use case?

My component1-->Tab(Data)-->multifield item1-->container(list)-->container(button)-->dropdown (below code doesn't work).

 

Just want to ensure that I am following the correct structure.

 

Thanks!