jQuery conditions pass through
<p>I made my own form validation just for 2 inputs, one is for Phone number and another one for Email address. and also I have 2 forms in 1 page.</p>

<p>my code is </p>

<pre><code>var email, phone;

if (email address validation passed) {
    email = true;
} else {
    email = false;
}

if (phone number validation passed) {
    phone = true;
} else {
    phone = false;
}

if (!(phone &amp;&amp; email)) {
    return false
} else {
    return true
}
</code></pre>

<p>as I have two forms on the same page, I'd like to have another snippet for the 2nd form like, </p>

<pre><code>var email2, phone2;

if (email address validation passed) {
    email2 = true;
} else {
    email2 = false;
}

if (phone number validation passed) {
    phone2 = true;
} else {
    phone2 = false;
}

if (!(phone2 &amp;&amp; email2)) {
    return false
} else {
    return true
}
</code></pre>

<p>the issue I found is that, for getting the form submitted I need to have <code>email, phone, email2, phone2;</code> all equal to true. however, I need to submit in condition if <code>email, phone are true</code> or <code>phone2, email2 are true</code>
Just need someone to check if this is a right logical way to solve my problem? </p>

<pre><code>if (!(phone2 &amp;&amp; email2)) {
    return false
} else if(!(phone  &amp;&amp; email )) {
    return false
} else return true;
</code></pre>
