Hello,
I have a radio button poll form. Right now, even if a user does not select a choice and hits the submit button, his answer is submitted to my database as an empty response, which I dont want. I want everyone to vote and only then the submission should work. I thought about not displaying the submit button before he votes, but then it did not seem like a good idea. I want the submit button displayed before he votes, but if he clicks it before voting, it should prevent the response to be sent to the database. Any ideas on how to do that?
Here is the submit button:
echo “<input type=”submit” value=”submit my answer”/>”;
and, if it matters, here is how i display the choices before that:
for($i=1; $i<=$qtotal; $i++)
{
$answer=”answer”.$i;
echo “<input type=”radio” name=”answer” value=$answer>”;
echo $questions[$i];
echo “</br>”;
}
Thanks