title: problems validating form input in a modal window with jquery
body: <p>Hi so i cant seem to figure out why this form will not validate on submit. I am not using the jquery library's built in validate function. Basically all the little code is doing for me is if the field is blank then show the error image and stop the form from being submitted.</p>
  
  <p>The form however is in a modal window which onclick on a button is faded in and can be closed. The problem i am having is that on submit the form is automatically being processed instead of jquery showing the errors.</p>
  
  <p>Here is the forms code</p>
  
  <pre><code>&lt;div id="blanket" style="display:none;" &gt;&lt;/div&gt;
  &lt;div id="window" style="display:none;" &gt;
      &lt;div id="close"&gt;&lt;a class="close" id="hidetrigger" href="#"&gt;&lt;img src="../images/close-btn.png" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;div class="formtitle"&gt;&lt;div class="required"&gt;Please fill in required fields (&lt;span class="asterix"&gt;*&lt;/span&gt;) below!&lt;/div&gt;&lt;/div&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;form id="quoteform" method="post" action="/" enctype='multipart/form-data'&gt;
      &lt;p&gt;&lt;label for="name" class="label"&gt;Name(&lt;span class="asterix"&gt;*&lt;/span&gt;):&lt;/label&gt;
         &lt;input type="text" class="fields" name="name"  /&gt;
         &lt;label class="error" for="name" id="name_error"&gt;&lt;/label&gt;
         &lt;select name="budget" class="dropdownfieldbudget"&gt;
                        &lt;option value="0"&gt;Please Select...&lt;/option&gt;
                        &lt;option value="N/A"&gt;N/A&lt;/option&gt;
                        &lt;option value="$1-200"&gt;$0 - $200&lt;/option&gt;
                        &lt;option value="$200-500"&gt;$200 - $500&lt;/option&gt;
                        &lt;option value="$500 +"&gt;$500 +&lt;/option&gt;
                      &lt;/select&gt;
      &lt;label for="budget" class="labelbudget"&gt;Budget(&lt;span class="asterix"&gt;*&lt;/span&gt;):&lt;/label&gt;
      &lt;label class="error" for="budget" id="budget_error"&gt;&lt;/label&gt;
  
      &lt;/p&gt;
  
      &lt;p&gt;&lt;label for="email" class="label"&gt;Email(&lt;span class="asterix"&gt;*&lt;/span&gt;):&lt;/label&gt;
          &lt;input type="text" class="fields" name="email"  /&gt;
          &lt;label class="error" for="email" id="email_error"&gt;&lt;/label&gt;
          &lt;input type="file" name="file" class="fileattach" /&gt;
          &lt;label for="file" class="labelfile"&gt;File(&lt;span class="asterix"&gt;.zip&lt;/span&gt;):&lt;/label&gt;
          &lt;label class="error" for="file" id="file_error"&gt;&lt;/label&gt;
      &lt;/p&gt; 
  
  
  
      &lt;p&gt;&lt;label for="organisation" class="label"&gt;Organisation:&lt;/label&gt;
          &lt;input type="text" class="fields" name="organisation"  /&gt;
                 &lt;label class="error" for="type" id="type_error"&gt;&lt;/label&gt;
         &lt;input type="checkbox" class="checkbtn" name="type" value="Graphic Design" /&gt;&lt;span class="checkbtn"&gt;Graphic's&lt;/span&gt;
         &lt;input type="checkbox" class="checkbtn" name="type" value="Conversion" /&gt;&lt;span class="checkbtn"&gt;Conversion&lt;/span&gt;
         &lt;input type="checkbox" class="checkbtn" name="type" value="Web Design" /&gt;&lt;span class="checkbtn"&gt;Web Design&lt;/span&gt;
         &lt;label for="budget" class="labelwork"&gt;Type(&lt;span class="asterix"&gt;*&lt;/span&gt;):&lt;/label&gt;
      &lt;/p&gt;
  
  
  
      &lt;p&gt;&lt;label for="country" class="label"&gt;Country:&lt;/label&gt;
          &lt;input type="text" class="fields" name="country"  /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label for="comment" class="label"&gt;Comments:&lt;/label&gt;
         &lt;textarea name="comment" class="txtfield" &gt;&lt;/textarea&gt; 
      &lt;p&gt;&lt;label for="hearabout" class="labelhear"&gt;Where did you hear about us?&lt;/label&gt;
                      &lt;select name="hearabout" id="hearabout" class="dropdownfield"&gt;
                        &lt;option value="0"&gt;Please Select..&lt;/option&gt;
                        &lt;option value="Another Website"&gt;Another Website&lt;/option&gt;
                        &lt;option value="Email"&gt;Email&lt;/option&gt;
                        &lt;option value="Online Advertisements"&gt;Online Advertisements&lt;/option&gt;
                        &lt;option value="Printed Media"&gt;Printed Media&lt;/option&gt;
                      &lt;/select&gt;&lt;/p&gt; 
  
      &lt;p&gt;&lt;label style="height:45px" for="submit" class="label"&gt;&lt;/label&gt;
          &lt;div class="submitwrapper"&gt;&lt;input type="submit" class="submitbtn" value="SUBMIT" name="submit"  /&gt; &lt;div class="success"&gt;&lt;span class="blue"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;  
          &lt;div class="clear"&gt;&lt;/div&gt;                     
  
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the jquery code.</p>
  
  <pre><code>$(".submitbtn").click(function() {
      $(".error").hide(); 
      var name = $("input#name").val();
          if (name == "") {
        $("label#name_error").show();
        $("input#name").focus();
        return false;
      }
      var email = $("input#email").val();
          AtPos = email.indexOf("@")
          StopPos = email.lastIndexOf(".")
      if (AtPos == -1 || StopPos == -1) {
        $("label#email_error").show();
        $("input#email").focus();
        return false;
      }
  }); 
  </code></pre>