Gary Finlay
|
| Posted: 04/25/2008, 9:28 AM |
|
I'm building a list of values for a list box.
The number of elements will vary therefore I need to do it in a loop.
Can anyone help me to put the following in a loop please?
$form->field->Values = array(array($submit[0], $show[0]),array($submit[1],
$show[1]), array($submit[2], $show[2],and so on.....));
TIA,
Gary
|
|
|
 |
wkempees
|
| Posted: 04/26/2008, 2:37 AM |
|
In the BeforeShow of the Listbox:
(example of building a listbox of birthyears higher than age 18, based on
current year)
// -------------------------
// Write your own code here.
// -------------------------
$year = date("Y") - 17;
for ($i=0; $i<=49; $i++)
{
$Component->Values[$i] = array($year,$year);
$year -=1;
}
//End Custom Code
Hope this helps.
"Gary Finlay" <garyf@online.ie> schreef in bericht
news:fut0ru$h44$1@news.codecharge.com...
> I'm building a list of values for a list box.
> The number of elements will vary therefore I need to do it in a loop.
> Can anyone help me to put the following in a loop please?
>
> $form->field->Values = array(array($submit[0], $show[0]),array($submit[1],
> $show[1]), array($submit[2], $show[2],and so on.....));
>
> TIA,
> Gary
>
>
|
|
|
 |
Gary Finlay
|
| Posted: 05/01/2008, 5:39 AM |
|
Superb. Thank you very much for your help.
"wkempees" <kempe819@planet.nl> wrote in message
news:fuut42$lnv$1@news.codecharge.com...
> In the BeforeShow of the Listbox:
> (example of building a listbox of birthyears higher than age 18, based on
> current year)
>
>
> // -------------------------
> // Write your own code here.
> // -------------------------
>
>
> $year = date("Y") - 17;
> for ($i=0; $i<=49; $i++)
> {
> $Component->Values[$i] = array($year,$year);
> $year -=1;
> }
>
> //End Custom Code
>
>
>
> Hope this helps.
>
>
> "Gary Finlay" <garyf@online.ie> schreef in bericht
>news:fut0ru$h44$1@news.codecharge.com...
>> I'm building a list of values for a list box.
>> The number of elements will vary therefore I need to do it in a loop.
>> Can anyone help me to put the following in a loop please?
>>
>> $form->field->Values = array(array($submit[0],
>> $show[0]),array($submit[1], $show[1]), array($submit[2], $show[2],and so
>> on.....));
>>
>> TIA,
>> Gary
>>
>>
>
>
|
|
|
 |
|