Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

validate field without required attribute #90

@zztop101

Description

@zztop101

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" >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions