I have a form inside a modal, that form allows user to update each model feild and I'm also using ember-validations to validate them, but then after successful saving or when a user closes/cancel the modal the form element still contain the class has-success, has-error, has-feedback
classes, so how can I reset the form fields after every successful saving/cancel?
Asked
Active
Viewed 572 times
0

r-r
- 307
- 2
- 15
1 Answers
0
It's common practice create new Form instance instead of cleaning errors. For each opening form/modal you should create new form
form: computed(function() {
return Form.create({ });
}),
actions: {
onShow() {
this.notifyPropertyChange('form');
}
}

Vasiliy vvscode Vanchuk
- 7,007
- 2
- 21
- 44
-
How can I handle that? Do you mean to create a dynamic form? – r-r Mar 18 '16 at 09:05