blazeworx / flagstrap

A lightwieght jQuery plugin for creating Bootstrap 3 compatible country select boxes with flags
http://blazeworx.github.io/flagstrap
MIT License
88 stars 62 forks source link

Any possible way for me to get the value attribute with your flagstrap...? #7

Closed naktieuthu closed 8 years ago

naktieuthu commented 8 years ago

I want to get the value from select box. By value here, I mean the ISO alpha2 for countries, for example:

'us': united states 'af': afghanistan 'cn': china

etc...

So, I want to get those us, af, cn .....value. How can I do that ..?

nonameolsson commented 8 years ago

I'm also interested in this.

sixlive commented 8 years ago

@naktieuthu @nonameolsson What if I added a callback to the options object that would essentially wrap a change event? Does that sound like something that would get you what you need?

$('.flagstrap').flagStrap({
  onSelect: function(value, element) {
    // do stuff
  }
});
nonameolsson commented 8 years ago

@sixlive Yes! :)

sixlive commented 8 years ago

@nonameolsson awesome, I'll get a PR together this weekend.

blazeworx commented 8 years ago

Added by Merge #10