insin / insin/newforms

Not rendered fields disappear from cleanedData after submit, if form is not valid

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
634
Forks
46
PR merge metrics
No merged PRs in 30d

Description

I have a field in which I set a value based on another component.
I don't render it, but I have custom validation for it in clean(), and I also show it's error in the page above my component.

The field: `geography : forms.CharField()`

I set it with the value of my component and it appears in the cleanedData object after I set it.
`this.state.form.updateData({geography: JSON.stringify(data)});`

The form has the `controlled: true` option.

If I submit the form and it is invalid, the value from geography disappears.

If render the field `renderField(fields.description)`, after one invalid submit my field does not disappear from cleandData.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.