Comments (12)
Ok, there was a glitch, this should be fixed in latest commit in v2 (No release created yet)
from form-data-json.
Empty multiselect is returned even if skipEmtpy
is true
EDIT
I am not sure, but array is not correspond to flat
Should be here something like [ 'client[status][]', 'saab', 'client[status][]', 'opel' ]
?
similar to how it was flattened by browser:
from form-data-json.
And at this case not all values are returned. I expect array of email
and phone
values (html code is above):
Arrays are expected, because there are three fields with (please see next post)client[person][0][phone][]
name, so array of 3 empty string elements should be returned. Same rule for other similar fields
example for comparison how data is returned without either options:
from form-data-json.
Not all form values are returned when flatList
is true
Expected:
When flatList
there array of fields with theirs values should be returned:
[
'client[person][0][phone][]', 'yy',
'client[person][0][phone][]', 'zz',
]
And vice-verse we can supply array field names with theirs values to .fromJson
from form-data-json.
Thx for report.
skipEmpty
now works in 2.0.3beta - All empty (empty array, empty fields) are deleted before output
flatList
now works in 2.0.3beta as suggested, same keys as native FormData would have
from form-data-json.
Why array of arrays instead of even sized array of key, value? I do not know where this already used, but it seems overkill.
In any case items with empty value should not be returned: docn
, docdate
from form-data-json.
The flatList
now is considered to reproduce FormData
behaviour. Key 0 is always the original input name, Key 1 is always the value of the input. If it is a multiple field, than it's for sure an array value.
Combination of flatList and skipEmpty still seems buggy, i'll look into that.
from form-data-json.
Combination of flatList and skipEmpty is fixed in latest commit.
from form-data-json.
No names for fields are returned:
from form-data-json.
Thanks. Lol. I need a break :) I come to you when i have something new.
from form-data-json.
working well, thank you ;-)
from form-data-json.
Nice. Thx.
from form-data-json.
Related Issues (20)
- v2-dev: make `uncheckedValue` false by default HOT 10
- 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.