title: How to display the checkbox value on same page without submit button and form in php?
body: <p>I have a checkbox and If any user selects the check box then the value of checkbox will display on the same page without refresh the page.</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;input  type="checkbox" value="&lt;?php echo $value;?&gt;" name="value_r" id="value_r"/&gt;
  
  if(!isset($_POST['value_r']))
  echo $_POST['value_r'];
  }
  </code></pre>
  
  <p>If ajax is good then can any one know how to display the value with ajax?</p>
  
  <pre><code>$("#value_r").change(function () {
      var isChecked = $(this).is(":checked") ? 1:0;
          $.ajax({
          type: "POST",
          url: "index.php",
          async: true,
          data: { isChecked: isChecked },
          success: function (response) {
          }
      });
    });
  </code></pre>