question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should an optionnal text field be posted with "" as a value when not filled ?

See original GitHub issue

Hello,

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
laudibertcommented, Apr 19, 2020

Alright then, I’ll try to come up with a PR !

1reaction
4ch1mcommented, May 8, 2021

I’ve created a new PR #178 which will fix the handling for integers/numbers; which imho is faulty atm.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found