Skip to content

Instantly share code, notes, and snippets.

@hatched
Created January 20, 2011 01:43
Show Gist options
  • Save hatched/787255 to your computer and use it in GitHub Desktop.
Save hatched/787255 to your computer and use it in GitHub Desktop.
/*
* Retrieves the value and text from the selected option in a select
*
* @method getSelectValues
* @public
* @since 1.0.0
* @returns [object]
*/
getSelectValues : function(inp) {
var value, txt;
value = inp.get('value');
inp.get('options').each(function(opt) {
if(opt.get('value') == value) {
txt = opt.get('text');
}
});
return {id: value, txt: txt};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment