micc83 / fontIconPicker

🌈 jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.
http://micc83.github.io/fontIconPicker/
MIT License
266 stars 87 forks source link

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

Closed DemersM closed 8 years ago

DemersM commented 9 years ago

If the

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 https://github.com/micc83/fontIconPicker/issues/20#issuecomment-84965193 .