Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing required/baselines settings not reading checked state properly…

… - bug 15:resolved
  • Loading branch information...
commit f0ce117d5ce52a8cb81e1f1dec025cd6cc1bfc28 1 parent a780f92
@viveleroi authored
Showing with 6 additions and 5 deletions.
  1. +1 −0  .gitignore
  2. +5 −5 js/jquery.formbuilder.js
View
1  .gitignore
@@ -2,3 +2,4 @@
*.tmproj
nbproject
.ftpssh_settings
+.idea
View
10 js/jquery.formbuilder.js
@@ -426,7 +426,7 @@
serialStr += opts.prepend + '[' + li_count + '][' + key + ']=' + encodeURIComponent($(this).attr(opts.attributes[att]));
// append the form field values
if (opts.attributes[att] === 'class') {
- serialStr += opts.prepend + '[' + li_count + '][required]=' + encodeURIComponent($('#' + $(this).attr('id') + ' input.required').attr('checked'));
+ serialStr += opts.prepend + '[' + li_count + '][required]=' + encodeURIComponent($('#' + $(this).attr('id') + ' input.required').is(':checked'));
switch ($(this).attr(opts.attributes[att])) {
case 'input_text':
serialStr += opts.prepend + '[' + li_count + '][values]=' + encodeURIComponent($('#' + $(this).attr('id') + ' input[type=text]').val());
@@ -442,7 +442,7 @@
}
else {
serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][value]=' + encodeURIComponent($(this).val());
- serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().attr('checked');
+ serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().is(':checked');
}
c++;
});
@@ -455,21 +455,21 @@
}
else {
serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][value]=' + encodeURIComponent($(this).val());
- serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().attr('checked');
+ serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().is(':checked');
}
c++;
});
break;
case 'select':
c = 1;
- serialStr += opts.prepend + '[' + li_count + '][multiple]=' + $('#' + $(this).attr('id') + ' input[name=multiple]').attr('checked');
+ serialStr += opts.prepend + '[' + li_count + '][multiple]=' + $('#' + $(this).attr('id') + ' input[name=multiple]').is(':checked');
$('#' + $(this).attr('id') + ' input[type=text]').each(function () {
if ($(this).attr('name') === 'title') {
serialStr += opts.prepend + '[' + li_count + '][title]=' + encodeURIComponent($(this).val());
}
else {
serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][value]=' + encodeURIComponent($(this).val());
- serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().attr('checked');
+ serialStr += opts.prepend + '[' + li_count + '][values][' + c + '][baseline]=' + $(this).prev().is(':checked');
}
c++;
});
Please sign in to comment.
Something went wrong with that request. Please try again.