How do I validate an email address with an if statement while removing the built-in validation?
<p>In my form I have a list item with an input type of "email".<br>
Well the problem with this is whenever I do not enter a valid email address in the input box, a pop-up shows up saying, "Please enter an email address."  So my question is how do I remove this pop-up and apply my own validation??
I tried putting novalidate = "novalidate" in the form, and that removed the pop-up, BUT I believe that's affecting my "if statement" because it is not working to validate the email address.  All my other "if statements" are working except for the one I wrote in the code below.
Here's a simple layout of my code:</p>

<pre><code>&lt;form action ="" novalidate="novalidate" method="post"&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;input type="email" name="email"&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/form&gt;

&lt;?php
    if (empty($errors) === true) {
        if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
            $errors[] = 'A valid email address is required.';
        }
?&gt;
</code></pre>
