Просмотр поста

.
GRIP
function AjaxFormRequest(result_id,form_id,url) 
  { 
   jQuery.ajax(
   { 
  url:     url, //Адрес подгружаемой страницы 
  type:     "POST", //Тип запроса 
  dataType: "html", //Тип данных 
 data: jQuery("#"+form_id).serialize(),  
 success: function(response) 
 { //Если все нормально 
                    
 document.getElementById(result_id).innerHTML = response;
 document.getElementById(form_id)reset(); 
                    
   }, 
  error: function(response) 
 { //Если ошибка 
 document.getElementById(result_id).innerHTML = "Ошибка при отправке формы"; 
  } 
  }
 ); 
}

 <div id="messages">
</div> 
     <form method="post" action="" id="form_id">
            <input type="text" name="phone" /><br/>
            <input type="button" value="Отправить" onclick="AjaxFormRequest('result_div_id', 'form_id', 'form.php')" />
 </form>