in form element group, don't throw if an element doesn't have a value method (which allows for adding buttons, for example)
This commit is contained in:
parent
82aeddccfe
commit
ceac7fa942
1 changed files with 3 additions and 3 deletions
|
@ -79,7 +79,7 @@ Ox.FormElementGroup = function(options, self) {
|
|||
|
||||
function getValue() {
|
||||
var value = self.options.elements.map(function($element) {
|
||||
return $element.value();
|
||||
return $element.value ? $element.value() : void 0;
|
||||
});
|
||||
return self.options.join ? self.options.join(value) : value;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ Ox.FormElementGroup = function(options, self) {
|
|||
? self.options.split(self.options.value)
|
||||
: self.options.value;
|
||||
values.forEach(function(value, i) {
|
||||
self.options.elements[i].value(value);
|
||||
self.options.elements[i].value && self.options.elements[i].value(value);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ Ox.FormElementGroup = function(options, self) {
|
|||
@*/
|
||||
that.value = function() {
|
||||
var values = self.options.elements.map(function(element) {
|
||||
return element.value();
|
||||
return element.value ? element.value() : void 0;
|
||||
});
|
||||
return self.options.joinValues
|
||||
? self.options.joinValues(values)
|
||||
|
|
Loading…
Reference in a new issue