Jump to content

Archived

This topic is now archived and is closed to further replies.

bassplaya4string

help with error report

Recommended Posts

I created a form with 10 radio buttons, if the user misses one of the buttons after clicking submit, I want an error message to come up. I got it working except the error message always comes up even if they have selected all of the radio buttons....here is my code....can someone please help!?
[code]
} else {
$i = 0;
$throw = false;

while ($i < 10)
{
$questions[$i] == null;
$throw = true;
$i++;

}

if ($throw) {
echo "It appears that you missed one of the questions. Please hit the back button and return to the quiz.<br />";
} [/code]

Share this post


Link to post
Share on other sites
you could just do it a different way.. like instead of:

$throw = true;

use

$throw = '1';

Then

if($throw == '1'){
  echo "Error message";
}

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.