Skip to content
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

Have form.reset() #189

Open
shellking4 opened this issue May 30, 2023 · 2 comments
Open

Have form.reset() #189

shellking4 opened this issue May 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@shellking4
Copy link

I don't know if it already exists and I'm not aware of it but I think we should have a reset method on form and use that to reset form after validations have succeeded and form submitted correctly.

@shellking4 shellking4 added the enhancement New feature or request label May 30, 2023
@taronaeo
Copy link

taronaeo commented Jul 7, 2023

@shellking4 createForm exposes a Svelte writable store named form. You can manually update the state by doing .set(INITIAL_STATE).

E.g.,

const initFormState = {
  email: '',
  password: '',
}

form.set(initFormState)  // reset fields

@jobayer977
Copy link

I think we have something like handleReset function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants