title: No value in input when submit using ajax
body: <p>I have this simple ajax form but when I submit no value in textbox</p>
  <p>This my html form</p>
  <pre><code>&lt;form name=&quot;form&quot;&gt;
    &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;origin&quot; name=&quot;origin&quot;/&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Add Flight&quot; class=&quot;submit&quot; /&gt;
  </code></pre>
  <p>and the script</p>
  <pre><code>$(document).ready(function() {
  
  $(function() {
    $(&quot;.submit&quot;).click(function() {
  
      var id = $(&quot;#id&quot;).val();
      var transaction = $(&quot;#transaction&quot;).val();
      var origin = $(&quot;#origin&quot;).val(); 
  
  console.log(dataString);
  if (id == '' || transaction == '' || origin == '' ) {          
        $('.success').fadeOut(200).hide();
        $('.error').fadeOut(200).show();      
  } else {
  $.ajax({ ...}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/FzTph.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FzTph.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/aJekf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aJekf.png" alt="enter image description here" /></a></p>