Form submission not working #51
-
At first thank to all the developers who created and maintaining this amazing library. For quite some time I was trying to create a wizard form. I have tried and tested different libraries but till now Formiz is the best. It was easy to learn and very easy to set up. So, I have created a three step wizard form using Formiz. First two steps works fine. But on the third step when I press the "submit" button, nothing happens. It doesn't submit the form. My
My
Here is the Code Sandbox Link If the form is submitted correctly the it should redirect to this page: As my form endpoint I am using formsubmit.co. For styling I am using Bootstrap. I'm stuck. Any help will be really appriciated. -Lily |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hello Lily 😃
<form
// action="https://formsubmit.co/lilyntalmers@gmail.com" // Remove this
// method="POST" // Remove this
noValidate
onSubmit={myForm.submitStep}
>
const handleSubmit = (values) => {
fetch(`https://formsubmit.co/lilyntalmers@gmail.com`, {
method: "POST",
body: values
})
.then((response) => response.json())
.then((data) => {
console.log(data)
alert('Success');
})
.catch(() => {
alert('Error');
});
}; Other things you have some errors in the console that you should fix ;) And also if you order to get the values of the radio buttons and the select, each should be a field ;)
I hope this can help 😉 |
Beta Was this translation helpful? Give feedback.
-
Thank you Ivan, It worked. I just had to modify the code a little bit. I am writing down the changes I made so it can helpful to anyone who is facing the same problem.
Instead of using It also works without the following code:
|
Beta Was this translation helpful? Give feedback.
Thank you Ivan, It worked. I just had to modify the code a little bit. I am writing down the changes I made so it can helpful to anyone who is facing the same problem.