diff options
| author | Eric Hagman | 2013-06-26 09:49:21 -0400 |
|---|---|---|
| committer | Ken Sheedlo | 2013-08-07 21:33:37 -0700 |
| commit | 306a613440175c7fd61d1d6eb249d1e53a46322e (patch) | |
| tree | 813e3c57b741a224ee608ac8d108b02a6d83aa82 /src/jqLite.js | |
| parent | 4be7612079f34c8b95c82f24b822e2ae06c82270 (diff) | |
| download | angular.js-306a613440175c7fd61d1d6eb249d1e53a46322e.tar.bz2 | |
fix(jqLite): return array from multi select in val()
Diffstat (limited to 'src/jqLite.js')
| -rw-r--r-- | src/jqLite.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jqLite.js b/src/jqLite.js index 775fef51..ae6da9f7 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -499,6 +499,15 @@ forEach({ val: function(element, value) { if (isUndefined(value)) { + if (nodeName_(element) === 'SELECT' && element.multiple) { + var result = []; + forEach(element.options, function (option) { + if (option.selected) { + result.push(option.value || option.text); + } + }); + return result.length === 0 ? null : result; + } return element.value; } element.value = value; |
