Javascript can't work simultaneously
<pre><code>&lt;script language="JavaScript"&gt;
    function validate(x) {



        var cur_p = document.getElementById('current').value;
        var new_p = document.getElementById('new').value;
        var con_p = document.getElementById('confirm').value;

        document.getElementById('msg_p').innerHTML = '';
        document.getElementById('msg_cur').innerHTML = '';


        if(x != cur_p)
        {   document.getElementById('msg_cur').innerHTML = ' Your password was incorrect';
            return false;
        }   

        if(new_p != con_p)
        {   document.getElementById('msg_p').innerHTML = 'Passwords do not match';
            return false;
        }

        return (true);

    }
&lt;/script&gt;
</code></pre>

<p>html</p>

<pre><code>&lt;form action='change-password.php' method='post' onsubmit="return validate('&lt;?=$current?&gt;')" &gt;
</code></pre>

<p>I have these on my code.
I can't show the result of these ifs simultaenously.</p>

<pre><code>if(x != cur_p)
and 
if(new_p != con_p)
</code></pre>

<p>if I place the </p>

<pre><code>if(x != cur_p){} 
</code></pre>

<p>at the top of </p>

<pre><code>if(new_p != con_p){}
</code></pre>

<p>the response result of if(x != cur_p) will show and the latter will not</p>

<p>and vice versa.</p>

<p>how can i show the result of those two ifs
(assuming that the condition for those were meet)</p>
