noahsalvi / svelte-use-form

The most compact reactive form controller (including Validation) that you'll ever see.
MIT License
252 stars 14 forks source link

Don't reload after click on submit button #48

Closed KolyStudio closed 1 year ago

KolyStudio commented 1 year ago

Hello, there is a way to not reload the page after submit the form? Thank you!

noahsalvi commented 1 year ago

Hello, there is a way to not reload the page after submit the form? Thank you!

Hey 👋

You can either add the svelte specific event modifier preventDefault like so <form on:submit|preventDefault>

or you could specify the type attribute of the element to be of type button <button type="button">...

Just note that this isn't caused by svelte use form. It's the default behavior of HTML5 forms.