script
script
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact Form</title>
<style>
.form-group {
margin-bottom: 10px;
.error-message {
color: red;
font-style: italic;
</style>
</head>
<body>
<div id="contact-form">
<div class="form-group">
</div>
<div class="form-group">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" required><br>
</div>
<button onclick="validateForm()">Submit</button>
</div>
<script>
function validateForm() {
if (!phoneNumber.match(/^\d{11}$/)) {
return false;
} else {
phoneError.textContent = "";
// If all validation passes, you can submit the form or further process data
}
</script>
</body>
</html>