Ok, so I have a little problem. I am creating a form that has a maximum value of 6 people, and up to 10 optional activities per person, which means that I have to have up to 60 defined radio values. In a table, I want something to look like this:
Activity 2 - Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.), with any unnecessary "Yes (.) No (.)" radio buttons not shown if there are, say, only 3 people.
The problem I have is, I want to program a loop statement to do this, but each radio button has an individual id that will be returned in another form... can I assign name id's to a button using a loop? here is what I have now, and then below that is what I "hope" to get an answer for, I think...
$a=0;
$b=0;
for($a=0;$a<$numActivity;$a++){
<tr><td width='100'>$activity[$a+1]</td>
for(mod($b,10)=0;mod($b,10)<$personQty…
"THE TEXT CUT OFF, THE REST OF THE 'FOR' STATEMENT GOES Qty;$b++){"
<td align='left' width='15'>
<input type='radio' name='person[$b+1]' value='yes'>yes
</td>
<td align='left' width='15'>
<input type='radio' name='person[$b+1]' value='no' checked>no
</td></tr>
};
$b = mod($a+1,10)*10;
};
In this loop, person1/person2/person3... are "defined" through the program, and then when the first activity loop finishes, the values of the second loop become person11/person12/person13...
Basically, how can I make make the values of activity[$a] and name='person[$b]' change appropraitely without programming 60 if/then statements?
Did I make sense, and can it work?????
Activity 2 - Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.) Yes(.) No (.), with any unnecessary "Yes (.) No (.)" radio buttons not shown if there are, say, only 3 people.
The problem I have is, I want to program a loop statement to do this, but each radio button has an individual id that will be returned in another form... can I assign name id's to a button using a loop? here is what I have now, and then below that is what I "hope" to get an answer for, I think...
$a=0;
$b=0;
for($a=0;$a<$numActivity;$a++){
<tr><td width='100'>$activity[$a+1]</td>
for(mod($b,10)=0;mod($b,10)<$personQty…
"THE TEXT CUT OFF, THE REST OF THE 'FOR' STATEMENT GOES Qty;$b++){"
<td align='left' width='15'>
<input type='radio' name='person[$b+1]' value='yes'>yes
</td>
<td align='left' width='15'>
<input type='radio' name='person[$b+1]' value='no' checked>no
</td></tr>
};
$b = mod($a+1,10)*10;
};
In this loop, person1/person2/person3... are "defined" through the program, and then when the first activity loop finishes, the values of the second loop become person11/person12/person13...
Basically, how can I make make the values of activity[$a] and name='person[$b]' change appropraitely without programming 60 if/then statements?
Did I make sense, and can it work?????