-1

I want to access AJAX response i.e data into PHP variable below defined div.I want to access AJAX response in PHP.

    <script> 
    $(document).ready(function(){ 
        $('#search').click(function(){ 
            var drop=[]; 
            var drop1; 
            drop1= $('.drop').val(); 
            $.ajax({ 
                url: 'test.php', 
                type: 'post', 
                data: {drop1:drop1}, 
                success:function(data){ 
                } 
            }); 
            return false; 
        }); 
    }); 
</script>
A J
  • 3,970
  • 14
  • 38
  • 53
babi
  • 85
  • 1
  • 14

1 Answers1

-1

According to explanation given in comments:

  1. Replace the type of button from submit to button.
  2. Use the serialize method to encode a set of form elements as a string for submission.
Ivnhal
  • 1,099
  • 1
  • 12
  • 20