Comments (4)
Maybe special value like boolean true/false could work as check/uncheck in this case but i'm not sure to add different behaviour depending on the value.
from form-data-json.
Thank you for your pull request. I came across this specific case in my tests and the current behaviour is exactly that what i wanted. It should only set the checkbox to true when the actual value is the same as the provided one.
The reason is simple: The data what you can get from .formToJson should set exactly the same with .fillFormFromJsonValues.
Imagine when you swap checkboxes in dom and they have no specific array key like name=ids[]
than you definitely not want to set to true when the value doesnt match.
from form-data-json.
Fair enough, I just figured I'd let you know incase the behaviour wasn't expected. I saw that there were no checkboxes in the demo either, so I though it might've slipped between the gaps.
from form-data-json.
Nice catch. Thank you, i should add checkboxes to the demo as well. In the real TestSuite at https://brainfoolong.github.io/form-data-json/tests/test.html there are all possible inputs.
from form-data-json.
Related Issues (20)
- v2-dev: make `uncheckedValue` false by default HOT 10
- 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
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.