Timeline for jQuery serialize does not register checkboxes
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 18, 2020 at 0:15 | comment | added | DavidCC | for .Net MVC, using values of True and False will allow mvc model mapping magic to set your Boolean model properties. And add these attributes to your <input> to get proper view rendering: value="@(Model.Item2.IsCurrent ? "True" : "False" )" @(Model.Item2.IsCurrent ? "checked='checked'" : "" ) | |
Nov 14, 2018 at 0:08 | comment | added | Annabel |
This code does work. It basically makes the checkbox control look like a normal input ( type text , or a select ) to the serialize() function by giving the checkbox a value property - that keeps in sync with the checked status. And it's more elegant than the selected answer.
|
|
Dec 18, 2013 at 17:01 | history | edited | Fury | CC BY-SA 3.0 |
added 199 characters in body
|
Dec 18, 2013 at 16:24 | history | edited | Fury | CC BY-SA 3.0 |
set input properly done
|
Dec 18, 2013 at 16:16 | history | edited | Fury | CC BY-SA 3.0 |
added 60 characters in body
|
Dec 18, 2013 at 16:09 | history | answered | Fury | CC BY-SA 3.0 |