Within my form, I am checking for the existence of an email address. If the email already exists, I display an error message from the JSON response when the user clicks the submit button.
When the email already exists, I receive a 409 error.
I am looking to update the email input field by adding a message indicating that the email already exists. I am utilizing ng-show="personalInfo.$submitted"
<form name="personalInfo" role="form" autocomplete="off">
<div class="form-group">
<input type="text" maxlength="11" class="form-control" name="usupiEmail" ng-model="usuAttributes.personalInfo.email" ng-focus="ShowPlaceholder('email')" />
<label>Email ID</label>
<div class="error-message" ng-show="personalInfo.$submitted" ng-cloak>
Please verify your Email.
</div>
</div>
<button type="submit" class="btn-default" ng-click="usupiUpdateUser()">Next</button>
I have also attempted a different method:
function checkWrongEmail (errorCode) {
if (errorCode === '409') {
return true;
}
return false;
}