Comments (3)
Hi, thanks for reaching out.
Unfortunately, this library is not designed to fix wrong form names. When form names are not named properly in ascending numeric order, they will not become an array.
The library cannot and will never know if this should be an array. Numbers 3,2,11 can even be an ID from your DB for example. In this case you absolutely not want the library to change this in the output.
So, this is absolutely not a bug of this library. This must be fixed in the form names itself.
This library will make an array, if you name it in ascending numeric order, starting from 0. Example: 0,1,2
from form-data-json.
Oh okay, it would be (I think), a good idea to add in the configuration a line allowing people (as in my case) to do this without having a name in our database with numbers and to put it in Array format.
I would understand if it's hard to do (it's just a feature that would be really nice =D ).
from form-data-json.
I understand your case, but this library is not intended to be used like that. Everything can be done with code, but this is not the right place for this piece of problem.
I suggest you, when you cannot change your input names, you manipulate the data, that comes out of toJson
, afterwards yourself.
Have a nice day.
from form-data-json.
Related Issues (20)
- FR: The way to assign `false` values for unchecked checkboxes HOT 5
- v2-dev: toJson return object instead of array: HOT 6
- v2-dev: implement `resetOthers` similar to .reset/.clear methods HOT 3
- 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
- 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
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.