Sending values ​​from a form with ajax per item


im trying to send values in a form via POST in ajax, how do i capture them in send them, this is wat i have now while in GET

    function test(ans_field_uuid){
        var result = "";
        var url="ajax_pages/remove_answer_field_ajax.php"
        url += '?uuid=' + ans_field_uuid;
        function (data) {
            result = data;
        .success(function () {
            if (result != "") {
                addTableRow('tb_add_field', result);
        .complete(function () {
        .error(function () {
            alert('An error has occurred.');
        return false;

since you already use jQuery

  type: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
}).done(function( msg ) {
  alert( "Data Saved: " + msg );

data: name and location are your POST variable. You can fetch the POST variable in this example in some.php with


which equals "John"

If you want to receive something then like "Hello". Inside your some.php

echo "Hello";

and it will be send to your ajax function as response in your done function as variable msg