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.

Form can be submitted even with validation errors

See original GitHub issue

Hey 😃

Are you submitting a bug report or a feature request

Bug report

What is the current behavior

Even with validation errors, I am able to submit a non-valid form if not all fields are rendered.

What is the expected behavior

I expect that I will be not able to submit a non-valid form that has validation errors.

How to reproduce the issue

I took Synchronous Record-Level Validation example and slightly modified it - removed two fields and added console.log with validation errors.

Here is a codesandbox demo - https://codesandbox.io/s/53xrn6v86p

Try to submit an empty form and you will have 3 validation errors. Now, fill in the only field in the form and you’ll still have 2 validation errors. Even though you have errors left, you will be able to submit the form.

Screen Shot

screen shot 2017-11-28 at 00 43 22


This bug also exists in redux-form and was mentioned in issues multiple times. 😢 Maybe it’ll be fixed in the final-form (the title sounds awesome) 🎉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
erikrascommented, Nov 29, 2017

The valid/invalid flags are currently based solely on registered fields.

Having thought about this for 24 hours, I think @VladShcherbin might be right. Non-registered field errors should also affect valid/invalid flags and halt submission.

2reactions
MichaelDeBoeycommented, Nov 29, 2017

@erikras extra functionality + reduced bundle size 🙂 Maybe you have to reconsider your

I plan on being a little more willing to say, “No, I will not implement your specific feature,” with this library, to minimize its complexity and surface area.

You can add “If it reduces bundle size, it will have a bigger change of being implemented” 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery form validation lets submitting form even with errors
i want the form NOT TO SUBMIT unless user has fixed all the errors. i tried to return false in submithandler but in...
Read more >
Form Validation Errors - how to track them and what to do ...
Error Message Placement​​ Usually, form validation errors are displayed on the same page that contains the form and are placed: contextually, next to...
Read more >
Form shows validation errors What to do? - Winshuttle Support
Open a form you like to check for validation errors. Then click F12 in the Internet explorer which will open up the right...
Read more >
How Validation Makes or Breaks Your Form - Logiforms
Here's how you can use form validation to your advantage. ... re-entered a value, scrolled back down, hit submit, only to be told...
Read more >
Form-Field Validation: The Errors-Only Approach
With live inline validation, the user would be first presented with a green checkmark as they input data in each field, and then...
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