Submitting empty values
See original GitHub issueI am having an issue submitting empty values for fields on an update form. For example, if I have a simple field:
<Text type="number" field="pay_amount" id="pay_amount" />
And, it’s initially loaded with a value, which works just fine. However, if I remove the value so that the field is now blank (which is what I want to send to the backend) the object that is passed to the onSubmit handler does not contain that field. Now, if I have a field that initially loads as blank/empty and it’s never touched, the onSubmit handler sees that field with a value of null, which is what I expect for the former example. Any guidance on how to get those empty values into the form submit? Thanks! And many thanks on a great form component!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:16 (9 by maintainers)
Top Results From Across the Web
How to prevent submitting the HTML form's input field value if ...
Show activity on this post. I have HTML form with input fields. Some of inputs can be empty, i.e. the value is ""....
Read more >Submit form doesn't work if you empty a value
Hi guys, Quick bug I discovered: If I open a Sharepoint item via a Form and one of the fields, I delete the...
Read more >JavaScript : HTML form - Checking for non empty - w3resource
The following function can be used to check whether the user has entered anything in a given field. Blank fields indicate two kinds...
Read more >Empty form values are not included on submit #430 - GitHub
Are you submitting a bug report or a feature request? ... Empty form values and pre-selected options are not included in the submit...
Read more >Form input values are empty after submit
Everything is working except when I submit the form and refresh the page it shows me for example 3 inputs but with empty...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just released!! 2.3.0 there are two new props
allowEmptyStrings
<<< Form level prop &&allowEmptyString
<<< field level propI was saying that the
allowEmptyString
prop would allow the user to setinitialValue
to''
and also when the backspace it would not remove and instead be''