Keep selected value after post check <p>I have a enquete. 1 of the pages looks like this:</p> <pre><code>&lt;form method="POST"&gt; &lt;input type="hidden" value="true" id="x" name="x"&gt; &lt;table&gt; &lt;b&gt;How relevant where the topics for your current and/or future business?&lt;/b&gt; &lt;hr /&gt; &lt;tr&gt; &lt;input type="hidden" value="1" name="question1"&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="1"&gt;1&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="2"&gt;2&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="3"&gt;3&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="4"&gt;4&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="5"&gt;5&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="6"&gt;6&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="7"&gt;7&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="8"&gt;8&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="9"&gt;9&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer1" value="10"&gt;10&lt;/td&gt; &lt;td&gt; &lt;textarea rows="4" cols="50" name="comment1"&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br /&gt;&lt;br /&gt; &lt;table&gt; &lt;b&gt;How did you value the networking opportunity?&lt;/b&gt; &lt;hr /&gt; &lt;tr&gt; &lt;input type="hidden" value="2" name="question2"&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="1"&gt;1&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="2"&gt;2&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="3"&gt;3&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="4"&gt;4&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="5"&gt;5&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="6"&gt;6&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="7"&gt;7&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="8"&gt;8&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="9"&gt;9&lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="answer2" value="10"&gt;10&lt;/td&gt; &lt;td&gt; &lt;textarea rows="4" cols="50" name="comment2"&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input id="enquete_next" type="submit" name="Add" value="Next"&gt; &lt;?php //If the form gets submitted, check if everything is okay. if(isset($_POST['x'])){ $validcomment = false; //validate if the answers are not empty. if they are empty go the the else statement. if(!empty($_POST['answer1'])){ if(!empty($_POST['answer2'])){ $validcomment = true; }else{ echo "Please fill in all the questions!" . "&lt;br&gt;"; } }else{ echo "Please fill in all the questions!" . "&lt;br&gt;"; } //If the form is filled in, and checked. Then do this! if($validcomment){ insert_page1(); } } ?&gt; &lt;/form&gt; </code></pre> <p>The following code is working. So when i fill in answer 1, but leave answer 2 empty. i get a message: Please fill in all the questions.</p> <p>However, i would like the form to keep its values. so i only have to fill in the empty answer instead of the whole form.</p> <p>Because right now, when it checks. The form gets empty and i have to fill it in all over again. </p>