Prevent a modal from opening again if there is an error
<p>I have a code that prevents a modal from opening when there is an error but the problem is when i open it once the next time it opens even if there is an error so the question is how to stop it from opening on the next time when there is an error again?</p>

<p>Here is the code:</p>

<pre><code>    jQuery(".link").click(function(a){   
    var newVal2 = jQuery("#appID").val();  
           if(error === '1' || defaultVal2 === newVal2){
               alert("Please fill in a valid App ID.");
               a.preventDefault();
           }    
           else {
               //Access Token Modal
    jQuery(".link").colorbox({inline:true, width:"90%"});
    a.preventDefault();
//Access Token Modal CLOSING
           }
   });
</code></pre>

<p>P.S <code>colorbox</code> is the modal plugin.</p>
