I've been working on validating a form and displaying the validation result directly under the text fields upon form submission.
Unfortunately, I've encountered an issue where I can't validate the input field on submit, but I am able to do so onBlur. I've tried different approaches for both onSubmit and onBlur methods. Below are the codes for onSubmit and onBlur respectively:
Here is my code snippet for this scenario:
formSumbit.html
<!DOCTYPE html>
<html lang="en" ng-app="testapp">
... // (Code continues here)
Despite the challenge with onSubmit validation, I have managed to successfully implement onBlur validation. The working code snippet for onBlur event is provided below:
<!DOCTYPE html>
<html lang="en" ng-app="testapp">
... // (Code continues here)