title: Ajax Form submit with preventDefault
body: <p>I have a normal HTML form in which it is supposed to  prevent default form submit and post the values by Ajax. It is not working with my setup Please help me where I went wrong. 
  See me as Novice in Jquery,javascrip</p>
  
  <pre><code> &lt;link rel="stylesheet" type="text/css" href="./jQuery MultiSelect Widget Demo_files/jquery.multiselect.css"&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="./jQuery MultiSelect Widget Demo_files/jquery-ui.css"&gt;
  &lt;script type="text/javascript" src="./jQuery MultiSelect Widget Demo_files/jquery.js"&gt;     &lt;/script&gt;
  &lt;script type="text/javascript" src="./jQuery MultiSelect Widget Demo_files/jquery.form.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="./jQuery MultiSelect Widget Demo_files/jquery-ui.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="./jQuery MultiSelect Widget Demo_files/jquery.multiselect.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(function(){
  
         $("select").multiselect({
            selectedList: 4
         });
  
      });
  &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var frm = $('#contactForm1');
  frm.submit(function (ev) {
      $.ajax({
          type: frm.attr('method'),
          url: frm.attr('action'),
          data: frm.serialize(),
          success: function (data) {
              alert('ok');
          }
      });
  
      ev.preventDefault();
  });
  </code></pre>
  
  <p></p>
  
  <p>My Form looks like </p>
  
  <pre><code>&lt;form action=index1.php id="contactForm1" method="post"&gt;
  &lt;p&gt;
      &lt;select name="example-list[]" multiple="multiple" style="width: 400px; display: none;"&gt;
      &lt;option value="option1"&gt;Option 1&lt;/option&gt;
      &lt;option value="option2"&gt;Option 2&lt;/option&gt;
      &lt;option value="option3"&gt;Option 3&lt;/option&gt;
      &lt;option value="option4"&gt;Option 4&lt;/option&gt;
  
      &lt;/select&gt;
  &lt;/p&gt;
  &lt;input class="text"  type="submit"  value='GO'&gt;
   &lt;/form&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>