I am struggling with validating an inscription form in HTML. Despite trying to implement validations, the inputs are still being saved in the database even when they are empty. Here are the validations I want to include:
- All inputs are required
- Email address should be valid
- Name should only contain letters
- Password must have a minimum of 8 characters, at least 1 uppercase letter, 1 lowercase letter, and 1 number
Additionally, I would like to display a message under every invalid input using
<div id="na"></div>
. How can I achieve this?
Below is my HTML file:
<h2 class="text-center">Inscription</h2>
<div class="row">
... // (HTML code here)
</div>
Here is my TypeScript file:
import { Component, OnInit } from '@angular/core';
... // (TypeScript code here)
Thank you in advance.