If was not alert go to url else do not go
<p>I want make validation jquery <strong>without using from plugin</strong>, problem is here that after click on button and get alert(if field is empty) it go to url <code>#</code> that there is in <code>&lt;form action="#"...</code>. </p>

<p>I want if get alert(mean if field is empty) 'input is empty' not go to url that there is in <code>...action="#"...</code>, if filed has value it go to url. i can not use from <code>ajax call</code> or <code>preventDefault</code> or <code>window.location</code>(Because one from field is <code>input:file</code>).</p>

<p><strong>Example:</strong> <a href="http://jsfiddle.net/gb7nh/1/" rel="nofollow">http://jsfiddle.net/gb7nh/1/</a></p>

<p>How can fix it?</p>

<pre><code>&lt;form action="#" method="POST"&gt;
    &lt;input type="text" name="name"&gt;
    &lt;button id="cli"&gt;Submit&lt;/button&gt;
&lt;/form&gt;


$('#cli').live('click',function(e){
        //e.preventDefault();
        if($('input[type="text"]').val()=='')alert('input is empty')
})
</code></pre>
