title: onclick form send via ajax no page refresh
body: <p>I've been racking my brains for days looking at examples and trying out different things to try and get my form to submit with Ajax without a page refresh. And Its not even sending the data now.. I don't know what I'm doing wrong..Can someone run through my ajax and form please.</p>
  
  <p>Toid is the users id and newmsg is the text in which the user submits. The two values get sent to the insert.php page. </p>
  
  <p>I would really appreate the help. I'm new to Ajax, and I look at some of it and don't have a clue. If I finally got it working, It may help me realize what I've done wrong. I am looking up tutorials and watching videos..but it can be very time consuming for something that would be simple to someone in the know on here. It maybe that I've got the wrong idea on the ajax and it makes no sense at all, sorry about that. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(document).ready(function(){
  
      $("form#myform").submit(function() {
  homestatus()      
  event.preventDefault();
  var toid = $("#toid").attr("toid");
  var content = $("#newmsg").attr("content");
  
      $.ajax({
          type: "POST",
          url: "insert.php",
          data: "toid="+content+"&amp;newmsg="+ newmsg,
          success: function(){
             }
      });
      });
  return false;
  });
  &lt;/script&gt;
  
  
  &lt;form id="myform"  method="POST"  class="form_statusinput"&gt;
  &lt;input type="hidden"  name="toid" id="toid" value="&lt;?php echo $user1_id ?&gt;"&gt;
  &lt;input class="input" name="newmsg" id="newmsg" placeholder="Say something" autocomplete="off"&gt;
  &lt;div id="button_block"&gt;
  &lt;input type="submit" id="button" value="Feed" onsubmit="homestatus(); return false" &gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>INSERT.PHP</p>
  
  <pre><code>$user1_id=$_SESSION['id'];
  if(isset($_POST['toid'])){
  
  if($_POST['toid']==""){$_POST['toid']=$_SESSION['id'];}
  
  if(isset($_POST['newmsg'])&amp;isset($_POST['toid'])){
  if($_POST['toid']==$_SESSION['id']){
  rawfeeds_user_core::create_streamitem("1",$_SESSION['id'],$_POST['newmsg'],"1",$_POST['toid']);
  }else{
  rawfeeds_user_core::create_streamitem("3",$_SESSION['id'],$_POST['newmsg'],"1",$_POST['toid']);
  </code></pre>