I want to remove the "please fill out this field" pop-up as validation and normal validations which are declared should display.
Html:
<div class="panel-body">
<form role="form" id="createForm" v name="createForm" ng-submit="createAdminGroup(adminGroupData)">
<div class="form-group" ng-class="{ 'has-error' : createForm.firstName.$invalid && !createForm.firstName.$pristine}">
<label class="label1">First Name</label>
<input name="firstName" id="firstName" class="form-control" placeholder="First Name" name="firstName" type="text" ng-model="adminGroupData.firstName " required/>
<span style="color:red" ng-show="createForm.firstName.$invalid && !createForm.firstName.$pristine">Please enter first name</span>
</div>
<div class="form-group">
<label class="label1">Last Name </label>
<input name="lastName" id="lastName" class="form-control" placeholder="Last Name" name="lastNmae" type="text" ng-model="adminGroupData.lastName" />
</div>
<div class="form-group">
<label class="label1"> Email Id </label>
<input type="email" name="email" id="email" class="form-control" placeholder="[email protected]" value=""ng-model="adminGroupData.email"/>
</div>
<div class="form-group">
<label class="label1"> Password </label>
<input name="password" id="password" class="form-control" placeholder="password" value="" ng-model="adminGroupData.password" />
</div>
<button name="submit" type="submit" class="btn btn-success" id="" ng-disabled="userForm.$invalid">Save</button>
<button class="btn btn-default" id="cancel" type="button" onclick='handleCancelCreateAdmin()'> Back </button>
</form>
</div>
Add novalidate
attribute to your form
to disable browser default validation
For Ex
<form role="form" novalidate id="createForm" v name="createForm" ng-submit="createAdminGroup(adminGroupData)">
Find more here
I just tried this and it worked:
oninvalid="this.setCustomValidity(' ')" oninput="this.setCustomValidity('')" >
I have add a space between the two single quotes.
Since i added a bootstrap tooltip on my input fields and required, the invalid input comes to focus and displays the tooltip value.
It was simpler than I thought it would be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With