Closed KES777 closed 3 years ago
Next will setup only phone
:
FormDataJson.fillFormFromJsonValues($("form")[0],
{docn : 'asdf', docdate: 'addd', client: { name: 'asdf DDD', phone: { 1: 'asdf' } } },
new FormDataJsonOptions({ unsetAllInputsOnFill: true })
)
source of my html:
<form>
<input name = "docn">
<input name = "docdate">
<input name = "client[name]">
<input name = "client[edrpou]">
<input name = "client[phone][]">
<input name = "client[phone][]">
<input name = "client[phone][]">
<input name = "client[email][]">
<input name = "client[email][]">
<select name="client[status][]" id="cars" multiple>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<input type="checkbox" name="scales[]" checked value="77">
<input type="checkbox" name="scales[]">
</form>
Thanks for your bug report. I can confirm the bug with unsetAllInputsOnFill = true
and nested values. I will fix this.
seems we must clear that flag when do recursive call https://github.com/brainfoolong/form-data-json/blob/master/src/form-data-json.js#L259
This error should be fixed in the new pre-release.
fixed
Describe the bug this does not setup all form values, just
client.name
:But this setup correct:
To mine mind problem is when we go into nested data, then it clear outer form fields