Closed Nazar84 closed 2 years ago
Do you have a fully reproducible example code? I cannot reproduce your problem, for me, when i have exactly the input you provided, it is not in the result as expected.
There is the code as it is:
<form action="/multidata" class="js-ajax" data-after-submit="updateForm" id="multiform" method="POST">
<input id="company_id" name="_Company[id]" type="hidden">
<p>
<div class="form-outline" >
<input class="form-control" id="company_name" name="_Company[name]" type="text" value="Comp1">
<label class="form-label" for="company_name">Company</label>
</div>
</p>
<input id="company_id" name="_Company[_Phone][0][id]" type="hidden">
<p>
<div class="form-outline" >
<input class="form-control" id="phone_phone" name="_Company[_Phone][0][phone]" type="text" value="22222222">
<label class="form-label" for="phone_phone">Phone</label>
</div>
</p>
<input class="btn btn-success btn-sm" style="font-size: 15px; font-weight: 600;" type="submit" value="Save">
</form>
And there is the data:
{
_Company => {
_Phone => [
{
id => ,
phone => 22222222,
},
],
name => Comp1,
},
}
Alright. This was indeed a bug, which should now be fixed with newest bugfix release.
Thank you!
Hi! I suppose I do not understand something. I need data in format:
The 'skipEmpty' is on 'true'. When I used the code without nesting array the empty value (id) was not presented in data:
<input type="hidden" name="_Company[_Phone][id]" class="form-control" />
Now I use
<input type="hidden" name="_Company[_Phone][0][id]" class="form-control" />
and data hasid: ,
with empty value. Why is that?