I have a code submit Form. Plz help me fix error

I have a code submit Form. Plz help me fix error

I have code index
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $("#login").validate({
  4. submitHandler: function(form){
  5. var name = $('#name').attr('value');
  6. $.ajax({
  7. type: "POST",
  8. url: "test.php",
  9. data: "name="+name,
  10. success: function(){
  11. $("#sao").load('test.php');
  12. }
  13. });
  14. }
  15. });
  16. });
  17. </script>
  18. <?php
  19. echo '<form action="test.php" method="post" id="login"><input type="text" id="name" /><input type="submit" id="submit" value="nhap" /></form>';
  20. echo '<div id="sao"></div>';
  21. ?>
Code test.php
  1. <?php
  2. if($_POST) {
  3. echo 'POSTED';
  4. } else
  5. echo 'NOT POST';
  6. ?>
I have entered and press the button "nhap" but I get results NOT POST. Plz help me fix this code