Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-selected-country does not returns code #19

Open
bakcay opened this issue Aug 4, 2016 · 1 comment
Open

data-selected-country does not returns code #19

bakcay opened this issue Aug 4, 2016 · 1 comment

Comments

@bakcay
Copy link

bakcay commented Aug 4, 2016

Added selected attribute at first to div
data-selected-country="TR"
And initialized
$('#tcountry').flagStrap({ onSelect: function(value, element) { console.log(value); } });
After this all country selections returns own country code but TR returns empty.
if i dont add attribute TR returns.

@jvillane
Copy link

jvillane commented Aug 11, 2016

This happens when you select the same option within the select.

Something that worked in our case was using the element variable to obtain the value, hope it works for someone else:

$(element).children("option[selected=selected]").val();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants