If you are using ng-show or ng-hide then add that condition to validation.

for example 

<div ng-show="isVisible">
<input ng-model="testModel" ng-required="isVisible" />
<span class="error" ng-show="testForm.testModel.$error.required && 
isVisible">required field</span>
</div>


On Thursday, May 17, 2012 2:37:51 AM UTC+8, Adam Wynne wrote:
>
> Hi guys
>
> Has anyone got a strategy for taking hidden inputs out of the validation 
> of a form (i.e. when ng-hide is true)? I have some hidden fields that are 
> preventing my form from having $valid = true
>
> Cheers
> Adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to