Prevent jquery submit on enter press on specific field
<p>How can I cancel the jquery submit from running when I press the enter key on a specific input field? </p>

<p>Something like this:</p>

<pre><code>var $canSubmit = true;
$('#profile_form')
    .keyup(function(e){         
        if (e.keyCode == 13 &amp;&amp; e.srcElement.name == 'countrySearch') {
            $canSubmit = false;
        } else
            $canSubmit = true;
    })
    .on('submit', function(e){
        e.preventDefault();
        console.log(e);

        if (!$canSubmit) return false;

        // first time enter is clicked when on countrySearch this is run as submit runs before keyup
        // i want all code here not to run when enter is clicked on input[name="countrySearch"]
    });
</code></pre>
