CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to build a list of values in a loop

Print topic Send  topic

Author Message
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
>>
>>
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.