Created
January 20, 2011 01:43
-
-
Save hatched/787255 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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