how to hide an if statment? or whatever technique can be done?
<p>I have an external javascript file, and it has multiple if statements, the problem is,
one of the if statements is still being called even if the form is hidden.
my application goes like this, 
- when a user is logged-in, hide this particular input form
- if not logged-in, show the input form</p>

<p>so that's the problem, the if statement for that input form using javascript, is still being called even if the input form is hidden, so what should I do to solve this?</p>

<p>here is the if statement for the input form</p>

<pre><code>     if(cvusername == "" || cvusername.length &lt; 5 || cvusername.length &gt; 30){
    alert("-username is required\n-should not be less than 5 characters\n and not greater than 30 characters");
    return false;
 }
</code></pre>
