Skip to content

Instantly share code, notes, and snippets.

@razass
Created October 14, 2010 21:26
Show Gist options
  • Save razass/627090 to your computer and use it in GitHub Desktop.
Save razass/627090 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