Closed KES777 closed 2 years ago
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:
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:
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
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
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
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.
Combination of flatList and skipEmpty is fixed in latest commit.
No names for fields are returned:
Thanks. Lol. I need a break :) I come to you when i have something new.
Ok, there was a glitch, this should be fixed in latest commit in v2 (No release created yet)
working well, thank you ;-)
Nice. Thx.
Describe the bug When nested form fields are not filled, they are included anyway
To Reproduce