Form Validation HTML

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>formValidation</title>
<Link rel="stylesheet" href="index.css">
</head>
<body>
<div>
<h2 class="heading"><span class="span">Form</span> Validation</h2>
<form id="registrationForm" class="form"
onsubmit="validateForm(event)">
<div>
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" >
<p id="nameError" class="error"></p>
</div>

<div>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" >
<p id="emailError" class="error"></p>
</div>

<div>
<label for="phone">Phone Number:</label><br>
<input type="tel" id="phone" name="phone">
<p id="phoneError" class="error"></p>
</div>

<div>
<label for="password">Password:</label><br>
<input type="password" id="password" name="password" required>
<p id="passwordError" class="error"></p>
</div>

<div>
<label for="confirmPassword">Confirm Password:</label><br>
<input type="password" id="confirmPassword"
name="confirmPassword" >
<p id="confirmPasswordError" class="error"></p>
</div>

<button type="submit" class="submit">Submit</button>


</form>

</div>
<script src="index.js"></script>

</body>
</html>

You might also like