title: Posting data to sql database without reloading page
body: <p>the problem is that i am unable to insert data in my database without reloading 
  i have tested it without the <code>note_sql.js</code> and my <code>note_sql.php</code> works fine but there seems to be a problem in my <code>js</code> file if some body could point me in the right direction it would be wonderful </p>
  
  <p><strong>Index.php</strong></p>
  
  <pre><code>    &lt;form id="noteform" action="note_sql.php" method="POST"&gt;
      &lt;input type="text" name="note"&gt;&lt;/input&gt;
      &lt;input id="sub" type="submit" value="Save Note" /&gt;
      &lt;/form&gt;
      &lt;span id="result_note"&gt;&lt;span&gt;
     &lt;script type ="text/javascript" src="jquery/note_sql.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>note_sql.js</strong></p>
  
  <pre><code>$("#sub").click(function(){
  
  var data = $("#noteform: input").serializeArray();
  $.post($("#noteform").attr("action"),data,function(info){$("result_note").html(info); });
      clearInput();
  }); 
  
  $("#noteform").submit(function(){
      return false;
  });
  
  function clearInput(){
      $("#noteform :input").each(function(){
          $(this).val('');
      });
  }
  </code></pre>