jQuery focus on Alert box with clicking on button
<p>I have a form, after submitting form when button is clicked using jQuery like this.</p>

<pre><code>function validate(){
   if($('#firstname').val() =="")
           alert("Please enter your first name");
   else if($('#lastname').val() == "")
    alert("Please enter your last name");
   else if( $('#association').val() == "")
    alert("Choose your association");
   else if($('#association_no').val() == "")
    alert("Please enter your association number");
   else
    $('#register').submit();
  }


  $(function(){


       $(".enter_submit").keyup(function(event) {
        if(event.keyCode === 13) 
        validate();

      })

  })
</code></pre>

<p>The alert box is displaying fine but my issue that When I press enter after alert box is displayed, it gives another alert box instead of getting rid of the alert(Works fine when I click OK with mouse). In FF, it gives #prevent more alerts from this page. So I believe its still focusing on the form even after alert is displayed. </p>
