Browse Source
Merge pull request #10556 from abpframework/berkan/serializeFormToObject-unchecked-checkbox-problem
Include unchecked checkboxes on serializeFormToObject
pull/10567/head
maliming
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
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
|
|
|
//serialize to array
|
|
|
var data = $(this).serializeArray(); |
|
|
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
|
|
|
//add also disabled items
|
|
|
$(':disabled[name]', this) |
|
|
$(':disabled[name]', this) |
|
|
.each(function (item) { |
|
|
.each(function (item) { |
|
|
|