title: HTML Radio Button saving first radio button value in Database
body: <p>I'm new to work Javascript &amp; ajax. I am creating a basic form &amp; saving the values in the Mysql database. After hitting the submit button only first radio button value is getting saved in Database. Can anyone help me out?
  <strong>Here is my HTML Code :</strong></p>
  
  <pre><code>&lt;form&gt;
      &lt;div class="form-group"&gt;
  
          &lt;div class="form-group"&gt;
              &lt;label&gt;Email:&lt;/label&gt;
              &lt;input type="email"  class="from-control" name="Name"&gt;
          &lt;/div&gt;
  
          &lt;label class="form-check-label"&gt;Gender&lt;/label&gt;
          &lt;div class="form-check-inline"&gt;
              &lt;input type="radio" class="form-check-input" name="Sex" id="Sex" value="Male" /&gt;Male
              &lt;input type=radio class="form-check-input" name="Sex" id="Sex" value="Female" /&gt; Female
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;button class="btn btn-primary" type="submit" id="btn_submit"&gt;Submit&lt;/button&gt;
              &lt;button class="btn btn-seconday" type="button" id="btn_cancel"&gt;Cancel&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>And my Javascript code:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('#btn_save').on('click',function() {
              var Email = $('#Email').val();
              var Sex = $('#Sex').val();
  
              $.ajax({
                  type : "POST",
                  url : "https://localhost/newCrud/test/save",
                  dataType : "JSON",
                  data: {Email:Email, Sex:Sex},
                  success : function (data) {
                      $('[name = "Email"]').val("");
                      $('[name = "Sex"]').val("");
                  }
              });
              return true;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>The Database structure</strong>
  <a href="https://i.stack.imgur.com/1Ay9o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Ay9o.jpg" alt="DB Structure"></a>
  <strong>Saved data from form submission</strong>
  <a href="https://i.stack.imgur.com/iec7D.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iec7D.jpg" alt="Saved data upon form submission"></a></p>
  
  <p>Kindly help me with my problem guys, I did my fair amount of research &amp; couldn't find solution to my problem. Thank you for you suggestions.</p>