Comments (10)
Hm, are your sure? It's set to false by default, i've double checked the tests, minified and not minified version of the current v2 branch.
from form-data-json.
I am sorry. I pull, but forget to copy dist to my directory =)
It works thank you.
from form-data-json.
The good/bad situation of this standard really depends on what forms you generate. The case also only applies for non indexed/autoincrement
keys in checkboxes, which is an edge case. To break compatibility with other software/v1 just for this very special case is not a good decision. Correctly indexed keys eg.: chk[foo]
still can be used in fromJson()
I can think of both good reasons for this behaviour and also for bad reasons.
If you really don't want this behaviour, it is an easy one-liner to make it globally.
FormDataJson.defaultOptionsToJson.uncheckedValue = false
from form-data-json.
Thanks for your feedback, i close this.
from form-data-json.
Good point. This is a tricky situation. I consider this a problem that native solutions never have fixed.
Generally, this library should do pretty much the same thing as native FormData
and PHP
by default and both do the same, they only make an array of the checked elements. If first is not checked, you loose the information to restore the form from given data.
But, i agree. This should be false
by default, to workaround this issues of native behaviours.
Will be changed.
from form-data-json.
Thx for report.
Changed as suggested in 2.0.3beta
from form-data-json.
does not work for commit:0361d0a
from form-data-json.
Thanks for your tests.
from form-data-json.
Ok, i have to really undo this. This behaves so differently to all standards, this is not good. In all standards (Browser, FormData, PHP, etc...) unchecked checkboxes are simply not submitted.
This library should do the same by default, i undo this in the beta to "undefined", it must be like that in my opinion.
Even if that mean, that you cannot use the result in fromJson()
when not setting uncheckedValue
by hand to null
or false.
from form-data-json.
IMHO: We see that standard behavior is ugly. There are tons of workarounds for this "standard" behavior...
Never understand why this "standard" must be by default if first thing will be escaping from it, workaround, etc.?
If this standard send broken data which gives nothing, why we should send it at all?
If you count that this library should be same by default, then I will not defend my opinion.
Also I does not support this "standard" default. ;-)
from form-data-json.
Related Issues (20)
- v2-dev: `skipEmpty` still includes empty arrays/objects HOT 12
- Document how to import this module HOT 18
- IncludeButtonValues does not include button values HOT 4
- Trigger for 'onchange' HOT 2
- Doesn't work when inputs are nested more than one child element deep HOT 1
- Focus Element metod HOT 1
- Implement FormDataGraphQL HOT 3
- Automatic array processing while fromJson HOT 2
- Get empty value in the data if use field name with nesting (array) HOT 4
- Name syntax with dot HOT 2
- Elements out of order are processed incorrectly HOT 4
- Conversion of a list of element[number] not done when a number is missing HOT 3
- radio element value 0 HOT 1
- how to skip non selected select option HOT 2
- Module parse failed: Unexpected token (15:30) HOT 4
- Use `import` instead of `require` HOT 3
- Wouldn't it be nicer if toJSON returns promise HOT 1
- Selection of checkboxes should based on values instead of order in DOM HOT 7
- Typing of typescript Suggestion HOT 2
- Proposal to Improve the Manipulation of Masked Field Values in Forms 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 form-data-json.