You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
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.
Hi,
if you add ng-required="!required" it will not have the green tick when it loads initially.
However, if you type in the field then remove what you type, it will then come up as "required field".
According to the quote below, I don't think you can use ng-required. Maybe you need to add a new directive to fab-forms.
The ng-required directive is necessary to be able to shift the value between true and false. In HTML, you cannot set the required attribute to false (the presence of the required attribute makes the element required, regardless of its value).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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" >
The text was updated successfully, but these errors were encountered: