How can I can call a API Or custom function instead of using default form actions #382
Replies: 2 comments 2 replies
-
Can you share a bit more on your setup? Are you running on Remix and how you are gonna call the API? (e.g. are you using remix fetcher or a raw fetch). In general, we expect the |
Beta Was this translation helpful? Give feedback.
-
I have a same problem but I was not quite able to follow your instructions. Here's the case that I have: We would like to have signup form on multiple pages so basically we would have a If the request is OK, we will redirect the user to thank you page. If not, we will return My question is, how can we then proceed to implement the To illustrate the problem, here's a modified starting point build from the tutorial example: The component:
The action:
So how can we do this? |
Beta Was this translation helpful? Give feedback.
-
I wanted to call the API instead of using default form post or get method.
The above code works, however if the form has any validation erros previously and input is updated with proper value, the submit works. But the previous error message is still shown, that may be due to the event.preventDefault().
Is there a any proper way to do custom submission?
Beta Was this translation helpful? Give feedback.
All reactions