Good morning, I have a form that does validations in php and not in javascript, and when an error happens I run a history.back () to return to the form. That returns a blank form. Does anyone have any ideas for me not to lose this data?
EDIT: I have a validation based on a grade (1 to 10). There are 30 questions. I put only one as an example. I run this if. You can also do this validation in javascript. But I do not know how. Can you help me thank you.
HTML
<div class="large-2 columns">
<label>Nota<br>
<input required="" type="radio" value="1" name="14_pesquisa">1
<input required="" type="radio" value="2" name="14_pesquisa">2
<input required="" type="radio" value="3" name="14_pesquisa">3
<input required="" type="radio" value="4" name="14_pesquisa">4
<input required="" type="radio" value="5" name="14_pesquisa">5
<input required="" type="radio" value="6" name="14_pesquisa">6
<input required="" type="radio" value="7" name="14_pesquisa">7
<input required="" type="radio" value="8" name="14_pesquisa">8
<input required="" type="radio" value="9" name="14_pesquisa">9
<input required="" type="radio" value="10" name="14_pesquisa">10
</label>
</div>
PHP
if(($pesquisa14 >= 9 and $pesquisa1 != 0)) {
ok.....
else{
$retorno = "<SCRIPT LANGUAGE='JavaScript' TYPE='text/javascript'>
alert('Algo deu errado. Tente novamente');
history.back();
</SCRIPT>";
echo $retorno;
}