Browse Source

Merge branch 'next' of github.com:Semantic-Org/Semantic-UI into next

pull/1785/head
jlukic 9 years ago
parent
commit
a179cb8806
1 changed files with 32 additions and 12 deletions
  1. 44
      src/definitions/behaviors/form.js

44
src/definitions/behaviors/form.js

@ -361,23 +361,43 @@ $.fn.form = function(fields, parameters) {
: false
;
if(name) {
if(isRadio) {
if(isChecked) {
values[name] = value;
if(name.indexOf('[]') !== -1) {
name = name.replace('[]', '');
if(!values[name]) {
values[name] = [];
}
if(isCheckbox) {
if(isChecked) {
values[name].push(value)
}
else {
module.debug('Omitted unchecked checkbox', $field);
return true;
}
}
else {
value.length && values[name].push(value);
}
}
else {
if(isRadio) {
if(isChecked) {
values[name] = value;
}
}
}
else if(isCheckbox) {
if(isChecked) {
values[name] = true;
else if(isCheckbox) {
if(isChecked) {
values[name] = true;
}
else {
module.debug('Omitted unchecked checkbox', $field);
return true;
}
}
else {
module.debug('Omitted unchecked checkbox', $field);
return true;
values[name] = value;
}
}
else {
values[name] = value;
}
}
});
return values;

Loading…
Cancel
Save