I have my code set up to check if the two email addresses match. If they do not match, I would like the email boxes themselves to turn red or a pop window to come up saying your emails do not match and let them try again. I can not figure out how to do this. I have it checking the two emails, and if they do not match it refreshes, the whole page and puts the message on top of the screen.
Here is my code
<tr>
<div class="form-group">
<input required type="email" name="email" value="" class="form-control" placeholder="Email-address">
</div>
</tr>
<tr>
<div class="form-group">
<input required type="email" name="email\\\_retype" value="" class="form-control" placeholder="Re-type Email-address">
</div>
</tr>
here is the code that checks if the emails match
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error = 'The email address you entered is invalid, please try again.';
echo "<div class='page_old_full'>
<p class='error'>ERROR: $error</p>
</div>";
break;
}
// checks if both emails are identical
if ($email !== $email_retype) {
$error = 'The two email addresses do not match. Please make sure they are the same.';
echo "<div class='page_old_full'>
<p class='error'>ERROR: $error</p>
</div>";
break;
}