Ajax post to a form

Ajax post to a form

Hi guys.
I'm trying to send form variables to a php form with POST, via an ajax call.
The php logic in the form seems to work when I test it.

But when I try to POST via $.ajax, the functions within my success callback don't get called, and no mail is sent.

I'm trying to figure out how to diagnose this problem further.

I've figured out the selector is correct: the function does get called when the button is clicked.

Here is the function in question:
(Is there anything obviously wrong with it?)
  1. $('#contact-form button').click(function(){
           

  2. var name = $("input#name").val();
          var email = $("input#email").val();
          var phone = $("input#phone").val();

  3.       var message = $("textarea#message").val() ;

  4.         var string = 'name' + name + 'email' + email +
            'subject' + subject + 'message' + message ;
     
            $.ajax({
            type: "POST",
            url: "/bin/process-form.php",
            data: string,
            success: function(){
                $('#contact-form')
                .html("<h2>Your message has been sent</h2>")
                .append("<p>We will be in touch soon.</p>") ;
            }//success ends
           
            });   
        });