diff --git a/.gitignore b/.gitignore index e4b8749..adfa11c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.tmproj nbproject .ftpssh_settings +.idea diff --git a/js/jquery.formbuilder.js b/js/jquery.formbuilder.js index 57368b7..8236061 100644 --- a/js/jquery.formbuilder.js +++ b/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++; });