setDeaults for several radio button groups..
| From: | Ellen Sundh | Date: | Thu, 14 Oct 2004 15:27:56 +0000 |
| Subject: | setDeaults for several radio button groups.. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14911@lists.php.net to get a copy of this message | ||
Hi!
I have problems with setting the default vaule for radiobuttons..
I have a set of 30 rows with radiobuttons.. each group is named type_0,
type_1..
If I just have one set of group there is no problem setting the detault
value for the radio buttons..
But as soon as there are several they are all set to the last value I feed
in to my defaultValues array..
$defaultValues = array();
for($i=0; $i<$playlist_maxItems; $i++) {
if($i == 0) {
$defaultValues["type_$i"] = "Live Session";
} else {
$defaultValues["type_$i"] = "None";
}
if(($i + 1)== $playlist_maxItems) $defaultValues["type_$i"] = "Selected
Remix";
}
$form->setDefaults($defaultValues)
I print out the array and get
Array ( [type_0] => Live Session [type_1] => None [type_2] => None [type_3]
=> None [type_4] => None [type_5] => None [type_6] =>...
But why is type_0 not set "to Live Session" in the form? It is set to
"Selected Remix".
Please let me know if there is any solution to this as I spent several days
on trying to solve this.
PS. The setDeault stuff works for all textfields I have in the same form.
Thanks in advance!
Ellen Sundh
--
Digit London Ltd :: Simple Human Interaction
54-55 Hoxton Square
London N1 6PB
T: +44 (0)20 7684 6970
F: +44 (0)20 7684 6767
E: ellen@digitlondon.com
W: http://www.digitlondon.com/