angular-validation icon indicating copy to clipboard operation
angular-validation copied to clipboard

Error validating a form

Open YamilBracho opened this issue 9 years ago • 3 comments

Hi, I would like to validate all my fiedls in my submit button, so I have my form :+1:

And in my submit button I got :+1: $scope.sendForm = function() { if (vs.checkFormValidity($scope.defuncionForm)) { helper.save(); } And in console this error is shown : angular.js:14324 checkFormValidity() requires a valid Angular Form or $scope/vm object passed as argument to work properly, for example:: fn($scope) OR fn($scope.form1) OR fn(vm) OR fn(vm.form1)

It seems to me that defuncionForm is not recognized as avalid HTML form ??

TIA, Yamil

YamilBracho avatar May 29 '17 16:05 YamilBracho

Do you have a form name in your html? Can you include the form declaration in the issue, just want to see the name.

I had issues with the checkFormValidity() function in the past (when passing a form name), I thought that I fixed them all but who knows, there might be still some issues with it. Another thing you can do which works better, if you only 1 form in the page, is to pass just the $scope, like this vs.checkFormValidity($scope)

ghiscoding avatar May 29 '17 22:05 ghiscoding

Hi, Yes, i set a name for the form... :-) I already solved it

Thanks a lot!!!

YamilBracho avatar May 30 '17 16:05 YamilBracho

Ok I will close this issue then

ghiscoding avatar May 30 '17 19:05 ghiscoding