-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPA support questions #523
Comments
|
|
|
It does not make sense for me. Sending data to an external api should happen in onSubmit, no? Look at react formik https://formik.org/docs/overview#the-gist |
No, it should happen when the data is valid and conveniently at hand, that's in onUpdate. onSubmit happens before the data is validated. |
@ciscoheat i am confused. In regular (server side) forms, the data is sent to the server when user clicks |
Without SPA:
Compare this to a SPA:
If you're still confused, read the SPA page and try harder to understand, many people are using it without problem. https://superforms.rocks/concepts/spa |
While it's correct that many people are using superforms without problems and it's the preferred solution for svelte. That being said, if people are accustomed to client-side focused form libraries, onSubmit would be the most commonly associated function to use for handling form submission (even after validation), like in TanStack Form and React Hook Form. As you're going against common practise in this case, I think it could be ideally highlighted to a greater deal in the documentation. |
onUpdate
used to submit a form in SPA mode without +page.ts? https://superforms.rocks/concepts/spa#without-a-pagets-fileThe text was updated successfully, but these errors were encountered: