How to submit html form with out loading

How to submit html form with out loading 

<script>
 $(function() {
 $("#lets_search").bind('submit',function() {

//Getting all variable from form input ids
 var form_name= $('#form_name').val();
 var form_email= $('#form_email').val();
 var form_phone= $('#form_phone').val();
 var travel_month= $('#travel_month').val();
 var form_message= $('#form_message').val();
 var ref= $('#ref').val();

//********
//printing a loading text after submit the form..wait....etc
$('#loading').css('display', 'block');
//***

$.post('send.php',{form_name:form_name,form_email:form_email,form_phone:form_phone,travel_month:travel_month,form_message:form_message}, function(data){

//after printing THANK YOU hide the text where <div id="loading">
$('#loading').css('display', 'none');
//*********

//Printing the result text where the <div id="search_results">
 $("#search_results").html(data);
 });
 return false;
 });
 });
 //******

</script>

************************************************
HERE the Form will be like this
****************************************************



<form id="lets_search2" method="post" action="">

<input type="text" id="form_name">
.......etc
form_name
form_email
form_phone
travel_month
form_message
ref
 <div id="search_results2"></div>
 <div id="loading" class="spinner" style="display:none; text-align:center">loading..</div>

</form>

 

Leave a Reply

Your email address will not be published. Required fields are marked *