Browse Source

Merge pull request #10556 from abpframework/berkan/serializeFormToObject-unchecked-checkbox-problem

Include unchecked checkboxes on serializeFormToObject
pull/10567/head
maliming 4 years ago
committed by GitHub
parent
commit
3e270214fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js

7
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js

@ -96,6 +96,13 @@
//serialize to array
var data = $(this).serializeArray();
// add unchecked checkboxes because serializeArray ignores them
$(this).find("input[type=checkbox]").each(function () {
if (!$(this).is(':checked')) {
data.push({name: this.name, value: this.checked});
}
});
//add also disabled items
$(':disabled[name]', this)
.each(function (item) {

Loading…
Cancel
Save