title: jQuery AJAX POST Form
body: <p>I tried to parse the form value into data variable for body request, but the body always return empty. It's mean my script not working to print the field value type by user into body data.
  within the HTML form:</p>
  
  <pre><code>&lt;form id="my-form"&gt;
      &lt;input type="text" id="MSISDN" name="MSISDN" placeholder="MSISDN"/&gt;
      &lt;input type="text" id="channel" name="channel" placeholder="channel"/&gt;
  
      &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here my javascript</p>
  
  <pre><code>&lt;script&gt;
  $.ajax({
      url: 'https://apiurl.com/users',
      dataType: 'text',
      type: 'post',
      headers: {
      'accept': 'application/json;charset=UTF8',
      'content-type': 'application/json',
      'api-key': 'judmkd895849438'
    },
      contentType: 'application/json',
  
  
      data: JSON.stringify( { "MSISDN": $('#MSISDN').val(), "channel": $('0').val() } ),
      //data: JSON.stringify( {MSISDN: document.getElementById("MSISDN").value, channel: "0"} ),
  
  
      processData: false,
      success: function( data, textStatus, jQxhr ){
          $('#response pre').html( JSON.stringify( data ) );
      },
      error: function( jqXhr, textStatus, errorThrown ){
          console.log( errorThrown );
      }
  });
  &lt;/script&gt;
  &lt;div id="response"&gt;
      &lt;pre&gt;&lt;/pre&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If the request success the response is:</p>
  
  <pre><code>{
      "UserDetails": [
          {
              "status": "Enabled",
              "UserID": "ABCS884784",
              "UserNo": "897363762827"
          }
      ],
      "customerStatus": null,
      "responseCode": 0,
      "responseMessage": "Details Fetched Successfully "
  }
  </code></pre>
  
  <p>but within my code the response always return error</p>
  
  <pre><code>"{\"customerStatus\":null,\"responseCode\":-2,\"responseMessage\":\"Inputs are invalid.\"}" 
  </code></pre>
  
  <p>that's mean the body value not filling up, can not fond whats wrong with my code so far </p>
  
  <p>Any help will appreciate,</p>