Prześlij formularz i pokaż wyniki na tej samej stronie bez odświeżania

<form id="myForm" method="post">
Name: <input name="name" id="name" type="text" /><br />
<input type="button" id="submitFormData" onclick="SubmitFormData();" value="Submit" />
</form>
<br/>
Your data will display below..... <br />
==============================<br />
<div id="results">
<!-- All data will display here  -->
</div>


<!-- SCRIPTS -->
function SubmitFormData() {
    var name = $("#name").val();
    $.post("submit.php", { name: name},
    function(data) {
	 $('#results').html(data);
	 $('#myForm')[0].reset();
    });
}

<!-- submit.php -->
<?php
  echo $_POST['name'] ."<br />";
  echo "=============== YOUR INSERT CODE ===============<br />";
  echo "All Data Submitted Successfully!";
?>
Rht