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

selected option is not updated when an icon is picked #20

Closed
DemersM opened this issue Mar 20, 2015 · 3 comments
Closed

selected option is not updated when an icon is picked #20

DemersM opened this issue Mar 20, 2015 · 3 comments

Comments

@DemersM
Copy link

DemersM commented Mar 20, 2015

If the got a value attribute, selected option is not updated when an icon is picked

Not working:

        <select>
            <option value="1">icon-airfield</option>
        </select>

Working:

        <select>
            <option>icon-airfield</option>
        </select>

You can see it here: https://jsfiddle.net/5m9wco4b/5/

@micc83
Copy link
Owner

micc83 commented Mar 23, 2015

Well, that's actually how it's supposed to work. The value of the option MUST be the same of the icon class name. What exactly are you trying to achieve here?

@DemersM
Copy link
Author

DemersM commented Mar 23, 2015

ok this is good to know that!

In my case, each icon is referenced with an object in the database. The value of the option is the pk of that object in order to be able to retrieve the selected object on server side when the form is submitted.

Would it be possible to achieve that?

@micc83
Copy link
Owner

micc83 commented Mar 23, 2015

I guess you could add a data-id attribute to each option and retrieve that
instead of the value/text...
Il 23/mar/2015 13:02 "Maxime Demers" notifications@github.com ha scritto:

ok this is good to know that!

In my case, each icon is referenced with an object in the database. The
value of the option is the pk of that object in order to be able to
retrieve the selected object on server side when the form is submitted.

Would it be possible to achieve that?


Reply to this email directly or view it on GitHub
#20 (comment)
.

@micc83 micc83 closed this as completed Sep 11, 2015
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