Form submission canceled because the form is not connected
See original GitHub issueThe WARNING: “Form submission canceled because the form is not connected” appears on the console when the user clicks in a cancel button that has the following code:
handleCancel = (evt) => {
this.props.reset();
this.props.router.replace('/');
}
What is the right way to CANCEL the form submission and navigating away from the page that has a redux-form?
I am using:
- redux-form: ^6.5.0
- react-router: ^3.0.2
- semantic-ui-react: ^0.66.0
- apollo-client: ^0.8.7
When the user clicks in the submit button, everything works fine (data is mutate using Apollo Client and navigating away from the page that has the form): no warning is shown
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Getting Error "Form submission canceled because the form is ...
Form submission canceled because the form is not connected. The simple fix is: Use onSubmit handler on the form; Remove the onClick handler...
Read more >Form submission cancelled because the form is not connected
The components seem to be working fine, but on console it shows an error saying Form submission cancelled because the form is not...
Read more >Form Submission Canceled Because the Form Is Not Connected
Form submission canceled because the form is not connected will ruin your day without clues of the cause. Read this post to see...
Read more >form submission canceled because the form is not connected
So, while clicking on the button, the onclick function is firing and the form is NOT submitting, and the console is printing –....
Read more >JavaScript : Getting Error "Form submission canceled because ...
JavaScript : Getting Error " Form submission canceled because the form is not connected " [ Gift : Animated Search Engine ...
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
That’s pretty strange. My guess is that you have:
and it should be
I think that most browsers default a
<button/>
to be a submit button, so you are both trying to submit the form and navigate away.Another option is to call
evt.preventDefault()
in yourhandleCancel()
function.Adding type=“button” worked great, thanks!