title: Button click with jquery cancel form and redirect page
body: <p><a href="http://jsfiddle.net/nqCFL/" rel="nofollow">http://jsfiddle.net/nqCFL/</a></p>
  
  <p>I'm trying to check the value of an input and if it's empty, redirect the page, if not empty, redirect to another page. It has no value as is and does not represent what I'm actually trying to do, it is just an experiment. This experiment is supposed to help me with the goal is to check the input and if it's empty, submit the form. If it's not empty, cancel the form and redirect to another page. I'm experimenting with Botcha and this is similar in idea. The problem is the page just continually refreshes on button click and never redirects according to the test I have above.</p>
  
  <p>The experiment I have is:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
      &lt;input type="text" placeholder="issue" class="issue-input" /&gt;
      &lt;button class="submit button" type="submit"&gt;Send&lt;/button&gt;
  &lt;/form&gt;
  
  $(".submit").click(function(){
              if($(".issue-input").val().length == 0) {
                  window.location.href = "http://www.google.com";
              } else {
                  window.location.href = "http://www.yahoo.com";
              };
  });
  </code></pre>