Name: Kaartika V.G Class and Sec: 3-C ROLL - NO: 50816 REG - NO: 2113141058116 Department: BSC Computer Science Topic: Client Side Validation
Name: Kaartika V.G Class and Sec: 3-C ROLL - NO: 50816 REG - NO: 2113141058116 Department: BSC Computer Science Topic: Client Side Validation
ROLL.NO: 50816
REG.NO: 2113141058116
if (!emailRegex.test(email)) {
alert('Invalid email format.');
return false;
}
if (!passwordRegex.test(password)) {
alert('Password must be at least 8 characters long
and include at least one uppercase letter, one lowercase
letter, and one digit.');
return false;
}
<label for="email">Email:</label>
<input type="email" name="email" id="email"
required><br>
<label for="password">Password:</label>
<input type="password" name="password"
id="password" required><br>
</body>
</html>
OUTPUT: