Should an optionnal text field be posted with "" as a value when not filled ?
See original GitHub issueHello,
I noticed that an optionnal text field is automatically sent as an empty string when not filled. I was wondering if that was intentionnal or not ? Should / could it be sending nothing instead ?
Sending { id: 1 }
instead of { id: 1, "randomOptField": "" }
when the user has not filled randomOptField
.
P.S. Great tool, thank you. Will PR on stuff if I manage to find some time.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Form fields — Required vs Optional | by jordane sanson
There are always more fields required than optional. Less visual noise on your form makes it more readable and therefore faster to complete....
Read more >Marking Required Fields in Forms
Only marking optional fields makes it difficult for people to fill out the form. Share this article:
Read more >How to mark required (and optional) fields in a form where ...
The obvious answer would be to use an asterisk to mark the required fields, yet it seems problematic to me since the read-only...
Read more >HTML field to be set as optional - css
Just remove the required attribute from the one you want to be optional and it won't require that to be filled out for...
Read more >optional - CSS: Cascading Style Sheets - MDN Web Docs
The :optional CSS pseudo-class represents any , , or element that does not have the required attribute set on it.
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 FreeTop 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
Top GitHub Comments
Alright then, I’ll try to come up with a PR !
I’ve created a new PR #178 which will fix the handling for integers/numbers; which imho is faulty atm.