-
Notifications
You must be signed in to change notification settings - Fork 58
3rd Party Addon is not working with $scope example. #135
Comments
Without looking at your example and since you mentioned the using as var validationService = new ValidationService({ scope: $scope, isolatedScope: $scope }); It helps in some cases to define it, give it a try. If that doesn't help, could you make a Plunker? It's usually the best way to troubleshoot someone else code (and since I'm at work, I won't open external zip). |
Hi, But it is not allowed to save if I put this scripts in body html. Can you copy this script reference to body and test? Thanks |
So here's a quick fix, I won't go into much details but passing the From your example, I changed this $scope.submit = function () {
if (validationService.checkFormValidity($scope.test)) {
alert('valid');
}
}; to this $scope.submit = function () {
// only pass the $scope or vm
if (validationService.checkFormValidity($scope)) {
alert('valid');
}
}; Give it a try and please close the issue if that fixes it. Thanks |
Hi ghiscoding, It worked with your code but it seems like checking validation entire view with function checkFormValidity(). I have 2 forms in a route view with Login view and Create new member view. I have 2 buttons to submit of each form and each button should only validate its elements. Any solution about this? Thanks |
Typically your code is suppose to work but I know that there's a little problem with passing the form's name, however I don't really have time to investigate the problem which why I have you the code to pass directly the How the That's the explanation of why it doesn't work, however not a full answer to your question |
CheckFormValidity was not working in all cases, there was a problem inside the function `getElementParentForm( )` which was returning null very often. This is due to the fact that `.form` only works with `input` element and so if user had validation on let say a `<div>` or any other Angular element that isn't an input then the `getElementParentForm( )` was returning null which was in turn making the `checkFormValidity($scope.formName)` and `$validationSummary` not working correctly.
Sorry for the long delay, I finally took some time to work on this issue. Your Plunker helped me put a fix in place, and it is now fully working with passing the Thanks for your patience and please update to your project to latest version 1.5.11 |
A small issue was created by prior version, please update to version 1.5.12 to be on the safe side. Could you also close the issue, if this fixes it. Thanks |
Hi ghiscoding,
Your example about 3rd Party Addon is working fine with the way using 'vm' and controllerAs. But it did not work correctly with the way using $scope like the other examples.
My example has 2 controls. Textbox and 3rd party dropdown. And only Textbox is validated.
I have attached my example. Can you please have a look what i am doing wrong or missing?
3rd Party Addon.zip
Thank you very much
The text was updated successfully, but these errors were encountered: