houssam_ballout
New Member
Hello all,
I'd multiple checkboxs and radio buttons , and they are generated automatically based on the database that I'd (mysql)..
on my page, I had queried all the questions and number of options, part of the code that I think you need is:
for($i=1;$i<=$NbOptions;$i++)
{
if($MultiAnswer == 'yes')
{
echo "<input type='checkbox' name='box[]' value='$idQuestion_$i' />" . $row2['option'.$i];
echo "<br />";
}
else
{
echo "<input type='radio' name='box[]' value='' />" . $row2['option'.$i];
echo "<br />";
}
}
when I press save ,
I use
if(isset($_POST['save']))
//here I want to loop through all the box[]?
and see if its checked or no
I'd multiple checkboxs and radio buttons , and they are generated automatically based on the database that I'd (mysql)..
on my page, I had queried all the questions and number of options, part of the code that I think you need is:
for($i=1;$i<=$NbOptions;$i++)
{
if($MultiAnswer == 'yes')
{
echo "<input type='checkbox' name='box[]' value='$idQuestion_$i' />" . $row2['option'.$i];
echo "<br />";
}
else
{
echo "<input type='radio' name='box[]' value='' />" . $row2['option'.$i];
echo "<br />";
}
}
when I press save ,
I use
if(isset($_POST['save']))
//here I want to loop through all the box[]?
and see if its checked or no