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

Reseting the form on submit #47

Closed
guciek27 opened this issue Jun 27, 2016 · 9 comments
Closed

Reseting the form on submit #47

guciek27 opened this issue Jun 27, 2016 · 9 comments
Assignees
Labels
Type: Feature New features and feature requests Type: Question Questions and other discussions

Comments

@guciek27
Copy link

Hello,
Is there a way to reset the form on submit? and if not than what would be your suggestion on doing that?

@radekmie radekmie added the Type: Question Questions and other discussions label Jun 27, 2016
@radekmie
Copy link
Contributor

No, there's no special API for that, but you can do it by setting your model prop to your desired after reset state - AutoForm will respect that. If you have a good use case for exposing such API, leave a comment here and let's discuss it.

@radekmie radekmie self-assigned this Jun 27, 2016
@guciek27
Copy link
Author

The workaround with model prop does not work. When a form has more than one field in it the value of the second field gets removed when I start typing in the first one.

We need that for a invite forms where after clicking invite the form is cleared.

@radekmie
Copy link
Contributor

Okay, it might be a problem with absent initial values. Give me some time to think this up. Also, every idea is welcome.

@radekmie radekmie added the Type: Feature New features and feature requests label Jun 27, 2016
@serkandurusoy
Copy link
Contributor

aldeed:autoform has this form reference and a reset() method attached to
it. it is very handy in managing the form lifecycle. we could use something
similar here.

On Mon, Jun 27, 2016 at 7:26 PM, Radosław Miernik notifications@github.com
wrote:

Okay, it might be a problem with absent initial values. Give me some time
to think this up. Also, every idea is welcome.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#47 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AEbz3D9njdGSSSnYe-fnJEu8CbhOGx8Nks5qP_nHgaJpZM4I_Hz5
.

@radekmie
Copy link
Contributor

Yes, it's achievable to do it with ref, but I don't like them, really (I know, it's a trivial reason, but maybe I'll come up with a different approach).

@radekmie
Copy link
Contributor

Usage is covered in README.md.

@serkandurusoy
Copy link
Contributor

Cool! Thanks!

On Tue, Jun 28, 2016 at 12:15 AM, Radosław Miernik <notifications@github.com

wrote:

Usage is covered in README.md
https://github.com/vazco/uniforms#reset-form.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#47 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AEbz3Mtks4LC3ddFonaSsb7sfI3XNPpYks5qQD1rgaJpZM4I_Hz5
.

@guciek27
Copy link
Author

@radekmie,
Let me know once the change is released :)
Thanks!

@radekmie
Copy link
Contributor

I've just released 1.0.0-rc.22.

@Monteth Monteth added this to Closed in Open Source (migrated) Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests Type: Question Questions and other discussions
Projects
Archived in project
Development

No branches or pull requests

3 participants