AJAX表单-组合函数

I have a form which checks if an item of stock is available in my ecommerce project that I am working on. You can see in the form, I have 2 buttons, and in the formm and to make the first function work, I have used the line <form class="text-center" onsubmit="addclient();return false"> I have 2 other functions which add the client and move the client. This line of code adds the client, there is a second one to move the customer. But I can only call this "register" function.

How can I incorporate the 2nd function into this form using the second button. I am very new to ajax and this is pretty complicated stuff. Hope someone can share their expertise. I appreciate this is a noob question

Thanks in advance for helping me out

I have 2 functions:

function checkavailability() {
    jQuery("#loading1").slideDown();
    jQuery.post("cart.php", { a: "options", sld: jQuery("#sld").val(), extension: jQuery("#extension").val(), checktype: 'register', ajax: 1 },
    function(data){
        jQuery("#results").html(data);
        jQuery("#results").fadeIn();
        jQuery("#topsay").hide();
        jQuery("#loading1").slideUp();

    });
}

The Second Function

function moveclient() {
    jQuery("#loading1").slideDown();
    jQuery.post("cart.php", { a: "options", sld: jQuery("#sld").val(), transfer: jQuery("#transfer").val(), checktype: 'transfer', ajax: 1 },
    function(data){
        jQuery("#results").html(data);
        jQuery("#results").slideDown();
        jQuery("#loading1").slideUp();
    });
}

The Form

<form onsubmit="checkavailability();return false">
  <input type="hidden" name="direct" value="true" />

     <input name="sld" id="sld" type="text" />  

     <div class="col-xs-12 col-sm-2">    
          <select>
              <option>Date1</option>
              <option>Date2</option>
              <option>Date3</option>
              <option>Date4</option>

           </select>
      </div>

    <button type="submit" class="button">Move</button>
    <button type="submit" class="button">Register</button>

</form>

You can change the buttons type to button, add a class cart, and add data attribute data-transfer to difference the buttons action.

<form id="form_id">
    ...
    <button type="button" class="button cart" data-transfer="transfer">Move</button>
    <button type="button" class="button cart" data-transfer="register">Register</button>
    ...

And in your script:

$(".cart").click(function(){
      var transfer_type = $(this).data("transfer");
      $("#loading1").slideDown();
      $.post("cart.php", { a: "options", sld: jQuery("#sld").val(), transfer: jQuery("#transfer").val(), checktype: transfer_type, ajax: 1 },
      function(data){
          HERE CODE RESPONSE
          $("#results").html(data);
          $("#results").slideDown();
          $("#loading1").slideUp();
          $("#form_id").submit();
      });
});

//Replace addClient() for submit event
$("#form_id").submit(function(e){
    e.preventDefault();
    //if need AJAX
    //CODE AJAX
    // or SUBMIT (POSTBACK)
    //this.submit();
    alert('SUBMIT');
});