Comments (3)
Ah, finally figured it out. Needed to do this instead:
`rc['forms.inviteForm'].needsAttention(forms.inviteForm.email)
and this works :). Might be good to add this to docs or allow first form somehow.
from angularjs-utilities.
Hmm, and back to the beginning apparently. What I'm trying to do is to reuse the form after submission. Immediately after submission I call $setPristine() on the form which works, but the form fields still show that there are validation errors even though they haven't been touched yet.
Any help is greatly appreciated.
from angularjs-utilities.
I found a fix that worked for me.
For Submit : I modified the following function to reset the form on submit completion:
this.setSubmitComplete = function (success, data) {
angular.forEach(submitCompleteHandlers, function (handler) {
handler({ 'success': success, 'data': data });
});
formController.$setPristine();
this.attempted = false;
};
For Cancel : I added the following function right above the this.needsAttention function:
this.reset = function() {
formController.$setPristine();
this.attempted = false;
};
Then : I added the rc.form to my cancel function in the HTML view
< button class="btn" id="btnCancel" type="button" ng-click="cancelForm(rc.my_info_form)" >
Cancel
</ button >
Last : I called the directives reset function from my cancel function
$scope.cancelForm = function (form) {
if(form){
form.reset();
}
}
Hope this helps anyone in the same situation.
Thanks,
RGB
from angularjs-utilities.
Related Issues (16)
- Add bower support HOT 12
- make auto focus feature configurable
- form validate with multiple buttons or submits HOT 1
- Subsequent open of the wizard is always going to the page where we left on previous open HOT 2
- Reference Files in bower.json HOT 1
- Dont show error message on start page
- How to enable/disable validation based on custom conditions for specific rc-step/form?
- jQuery().mailgun_validator can't find plugin
- How to forward the wizard to next form based on response from service?
- Provide a Licence HOT 1
- Add version info to files
- rc disabled is not triggering when there is change in value
- Version number needs bumping HOT 1
- rcMailgunValid directive HOT 3
- jQuery referenced in source
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularjs-utilities.