Unable to read value in Drop down in Firefox

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

12-02-2019

Hi All,

I have Dropdown widget of  type "granite/ui/components/coral/foundation/form/select" which has 3 values(None,Standard,Featured).Based on the selection of a value in this dropdown I need to hide/show other widgets.In Chrome browser,i am able to get the selected value where as in Firefox always i am getting blank unable to fetch th selected value.

Below is the code snippet which I am using to achieve this.

$(document).on("foundation-contentloaded", function () {              

       var selectedPromoTypeOption = $('.promo-type-selection coral-select-item[selected]').val();

       alert("selectedPromoTypeOption::"+selectedPromoTypeOption);

       if (selectedPromoTypeOption == "none" || selectedPromoTypeOption == "standard") {

           $('.article-color-options').closest('.coral-Form-fieldwrapper').addClass('hide');

       }

})

Anyone has any idea ,how to fetch the selected irrespective of the browser.

Thanks,

GK   

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

12-02-2019

I talked to our team about this. The reply was:

Hey here is a sample

https://experience-aem.blogspot.com/2019/02/aem-6420-adding-composite-multifield-items-based-on-cora...

1. get the select

var $countSelect = $("coral-select[name='" + COUNT_SELECT + "']");

2. get the value

var maxCount = parseInt(countSelect.value),

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

13-02-2019

I have followed the article and tried to get the value as mentioned in the article but not able to read value.

In Firefox browser, when evaluating this expression it's always returning emprty value.

Is there any other way to read the value ir-respective of browser?

var selectedPromoTypeOption = $('.promo-type-selection coral-select-item[selected]').val();