QF: Dynamically generating radio groups?
| From: | Barry Kafka | Date: | Sun, 19 Oct 2003 19:51:31 +0000 |
| Subject: | QF: Dynamically generating radio groups? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8489@lists.php.net to get a copy of this message | ||
Hi,
How do I dynamically generate radio group names in my
loop? I want my statement to look like this:
$hhm_1_gndr[] =
$HTML_QuickForm::createElement('radio', $i, null,
'Male', 'male');
and so on, through the end of my loop.
I tried the variable variable code below but it didn't
work. Maybe it's just a PHP syntax issue.
######
$gndr_grp_name = "hhm_".$i."_gndr[]";
$$gndr_grp_name =
&HTML_QuickForm::createElement('radio', $i, null,
'Male', 'male');
$$gndr_grp_name =
&HTML_QuickForm::createElement('radio', $i, null,
'Female', 'female');
$form->addGroup($$gndr_grp_name, 'hh_mem_gndr',
'Member’s Gender:');
######
thanks in advance if you can help me.
Barry
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com