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

Issue on form validate

Open pcamarajr opened this issue 9 years ago • 0 comments

I've added the angular recaptcha directive inside my form, and I use the property myForm.$valid to enable my submit button.

I inform the required fields and validate the captcha and my button got enabled, was expected, but, if I wait for the expiration of the captcha, my button wasn't getting disabled again. Hope that you can understand my bad english.

I fixed this in my project by adding a scope.$apply inside the validate() function, and now all works fine. My question, is it a possible bug or not?

 function validate(){
   if(ctrl){
     ctrl.$setValidity('recaptcha', scope.required === false ? null : Boolean(scope.response));
   }
   scope.$apply;
 }

pcamarajr avatar May 19 '16 20:05 pcamarajr