Comments (5)
Can you send me an example of how you are serializing the checkbox data?
from jquery-deserialize.
<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.11.0.min.js"></script>
<script src="jquery.deserialize.min.js"></script>
<script>
function ser() {
var serialized = $('#settings').serialize();
console.log('serialized', serialized);
$('#ser').text(serialized);
}
function deser() {
$('#settings input[type=checkbox]').attr('checked', false);
$('#settings').deserialize($('#ser').text());
}
</script>
</head>
<body>
<form id="settings" action="javascript:void(0);">
<p><input id="c1" name="c1" type="checkbox" checked="checked"><label for="c1">checkbo without explicit value</label></p>
<p><input id="c2on" name="c2on" type="checkbox" checked="checked" value="on"><label for="c2on">checkbox with value="on"</label></p>
<p>
<input type="button" value="serialize" onclick="ser(); return false;">
<span id="ser">...</span>
<input type="button" value="deserialize" onclick="deser(); return false;">
</p>
</form>
</body>
</html>
from jquery-deserialize.
Thanks, I'll dig into this soon.
from jquery-deserialize.
I'd just like to point out that according to spec, all type="checkbox"
inputs are required to have a value
attribute. So, this is invalid HTML.
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
value:
The initial value of the control. This attribute is optional except when the value of the type attribute is checkbox.
from jquery-deserialize.
Oops. Sorry for the “bug” report. I’ll go now and fix my broken HTML.
from jquery-deserialize.
Related Issues (20)
- Multiple selects with same name are not deserialized properly HOT 3
- checking for undefined with typeof
- Request: refactor deserialize into reusable function so that it returns an object HOT 2
- Support CakePHP checkbox HOT 1
- Deserialize data to be used in script. HOT 3
- Does not work with nested field names HOT 6
- Minified version does not properly deserialize some selects HOT 2
- When a field is not found, the change callback is not called HOT 2
- how about npm?) HOT 2
- with disabled the deserialize not working HOT 2
- npm install: missing files HOT 1
- jquery-deserialize does not remove selection before deserialization multiple select HOT 8
- Force adding options to multi select HOT 1
- RFE: deserialize function should fire change events HOT 2
- Could we get it to deserialize complex objects HOT 1
- handle JSON boolean values for checkboxes true/false values HOT 2
- Error when loading the plugin HOT 1
- Dual licence HOT 2
- Will there be a new release? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-deserialize.