ng-fab-form icon indicating copy to clipboard operation
ng-fab-form copied to clipboard

validate field without required attribute

Open zztop101 opened this issue 7 years ago • 2 comments

Hi,

How can I validate email address when there is no "required" attribute

This does not display invalid email: <input type="email" class="form-control" placeholder="Email" ng-model="formData.email" >

This displays invalid email but field is required, when I want it optional. <input type="email" class="form-control" placeholder="Email" ng-model="formData.email" required >

I tried this which is a step closer, However when the form initially appears it is already ticked. It does not seem to matter what is the ng-required field.

<input type="email" class="form-control" placeholder="Email" ng-model="formData.email" ng-required="formData.email.length > 0" >

zztop101 avatar Aug 18 '16 00:08 zztop101