title: Getting radio button value by ajax
body: <p>I want to get radio button values and send them through AJAX to PHP.</p>
  
  <p>My AJAX is running but is currently inserting a <code>0</code> in each row, so it's not picking up the value from the radio button. Any help would be appreciated.</p>
  
  <pre class="lang-js prettyprint-override"><code>$("#save_privacy").submit(function() {
    var message_pri = $("#message_pri").val();
    var follow_pri = $("#follow_pri").val();
    var post_pri = $("#post_pri").val();
    var check7 = $("#check7").val();
  
    var s = {
      "message_pri": message_pri,
      "follow_pri": follow_pri,
      "post_pri": post_pri,
      "check": check7
    }
  
    $.ajax({
      url: 'edit_check.php',
      type: 'POST',
      data: s,
      beforeSend: function() {
        $(".privacy_info").html("&lt;img src=\"style/img/ajax/load2.gif\" alt=\"Loading ....\" /&gt;");
      },
      success: function(data) {
        $(".privacy_info").html(data);
      }
    });
  
    return false;
  });
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form id="save_privacy"&gt;
    &lt;table align="center" width="70%" cellpadding="0" cellspacing="0" border="0"&gt;
      &lt;tr&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;b&gt;Message Buttun: &lt;/b&gt;
        &lt;/td&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;input type="radio" id="message_pri" name="message_pri" value="1" /&gt; ON
          &lt;input type="radio" id="message_pri" name="message_pri" value="2" /&gt; OFF
          &lt;input type="radio" id="message_pri" name="message_pri" value="3" /&gt; FOLLOWERS
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;b&gt;Follow Buttun: &lt;/b&gt;
        &lt;/td&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;input type="radio" id="follow_pri" name="follow_pri" value="1" /&gt; ON
          &lt;input type="radio" id="follow_pri" name="follow_pri" value="2" /&gt; OFF
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;b&gt;Who Can Post On Your Profile: &lt;/b&gt;
        &lt;/td&gt;
        &lt;td style="padding: 5px;"&gt;
          &lt;input type="radio" id="post_pri" name="post_pri" value="1" /&gt; Evry one
          &lt;input type="radio" id="post_pri" name="post_pri" value="2" /&gt; Followers
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td colspan="2" style="padding: 5px;"&gt;
          &lt;input type="hidden" id="check7" value="save_privacy" name="check7" /&gt;
          &lt;input class="small color blue button" type="submit" value="Save" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;div class="privacy_info"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>