Giter Club home page Giter Club logo

Comments (12)

brainfoolong avatar brainfoolong commented on June 14, 2024 1

Ok, there was a glitch, this should be fixed in latest commit in v2 (No release created yet)

from form-data-json.

KES777 avatar KES777 commented on June 14, 2024

Empty multiselect is returned even if skipEmtpy is true

image

EDIT
I am not sure, but array is not correspond to flat
image

Should be here something like [ 'client[status][]', 'saab', 'client[status][]', 'opel' ]?
similar to how it was flattened by browser:
image

from form-data-json.

KES777 avatar KES777 commented on June 14, 2024

And at this case not all values are returned. I expect array of email and phone values (html code is above):

image

Arrays are expected, because there are three fields with client[person][0][phone][] name, so array of 3 empty string elements should be returned. Same rule for other similar fields (please see next post)
image

example for comparison how data is returned without either options:
image

from form-data-json.

KES777 avatar KES777 commented on June 14, 2024

Not all form values are returned when flatList is true

image

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.

brainfoolong avatar brainfoolong commented on June 14, 2024

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.

KES777 avatar KES777 commented on June 14, 2024

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
image

from form-data-json.

brainfoolong avatar brainfoolong commented on June 14, 2024

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.

brainfoolong avatar brainfoolong commented on June 14, 2024

Combination of flatList and skipEmpty is fixed in latest commit.

from form-data-json.

KES777 avatar KES777 commented on June 14, 2024

No names for fields are returned:

image

from form-data-json.

brainfoolong avatar brainfoolong commented on June 14, 2024

Thanks. Lol. I need a break :) I come to you when i have something new.

from form-data-json.

KES777 avatar KES777 commented on June 14, 2024

working well, thank you ;-)

from form-data-json.

brainfoolong avatar brainfoolong commented on June 14, 2024

Nice. Thx.

from form-data-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.