title: populate radio button value after submit
body: <p>I try to implement the follwing code:</p>
  
  <pre><code>    &lt;?php
      $yesno1="";
      $yesno2="";
      $option1="";
      $option2="";
      $option3="";
     if(isset($_POST['submit'])){
        $yesno1=$_POST['yesno1'];
        $yesno2=$_POST['yesno2'];
        $option1=$_POST['option1'];
        $option2=$_POST['option2'];
        $option3=$_POST['option3'];
       } 
      ?&gt;    
     &lt;form method="POST" name="contact_form"
    action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']); ?&gt;"&gt;
   &lt;input type="radio" name="yesno1" value="yes" style="outline:0;"/&gt;Yes
   &lt;input type="radio" name="yesno1" value="no" style="outline:0;"/&gt;No
   &lt;input type="radio" name="yesno2" value="yes" style="outline:0;"/&gt;Yes
   &lt;input type="radio" name="yesno2" value="no" style="outline:0;"/&gt;No
   &lt;input type="checkbox" name="option1" value="Milk"&gt; Milk&lt;br&gt;
   &lt;input type="checkbox" name="option2" value="Butter" checked&gt; Butter&lt;br&gt;
   &lt;input type="checkbox" name="option3" value="Cheese"&gt; Cheese&lt;br&gt;
   &lt;input type="submit" value="Submit" name='submit'&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>Once I click submit button, normally the value I seleted in radio and marked in the checkbox are gone, so how can I keep the value even after the click the submit button or refrsh the page using php, javascript is fine as well, would be better if any one can help me with it on both php and javascript since I am not very good on both of them, thanks for kind help:)</p>