Hi,
I am working on an implementation where i render some active records (models) and allow user to choose one of them
i have multiple sets where each contains multiple choices
e.g each set has more that one options/choices to chose from.
So to take input from user, i decided to use radiobuttonList() for each set (rendering all options)
Here is what i am doing…
$cntSets = count($sets);
for($setIndex =0; $setIndex<$cntSets;$setIndex++)
{
$count = count(choices);
$choices = $sets[$setIndex]['choices'];
foreach($choices $i=>$item)
{
$option = array();
for($i = 0; $i < $count;$i++)
{
$option[$ind] = $choices[$i]['label'];
}
echo $form->radioButtonList($item, "[$i]attributeOfChoice",
$option,
array('separator'=>''));
}
}
but i want user to choose only one of them which user can. but i not able to figure out a way to know which option was choosen.
is there any way to store id of each "choice" choosen out of every set.
One alternate solution i could think of is, replacing $item with $set and create an attribute in $set to take this input.
i just need a clue how to actually save the id of "choice" i.e. $choices[i].id…!
Pls suggest…!
-Big O