nat
|
| Posted: 07/09/2002, 11:42 PM |
|
how can i create listboxes by specifying a number of listboxes ie. i enter number 5 then it will show 5 listboxes containing items from database
regards,
nat
|
|
|
 |
Nicole
|
| Posted: 07/10/2002, 7:17 AM |
|
Nat,
it could be done as described below. But note, that the solution proposed below will just duplicate the existing listbox and all listboxes will contain the same data. Moreover if you want to use it on the Record form, it won't affect on the table update because in real only one field exists and the code for insert/update statements is generated for one field.
Well, the first step is to add listbox on the form. Lets name it "s_order_id".
- Then switch to HTML tab and find code related to the listbox. Sorround it with html comments like:
<!-- BEGIN BlockName -->
<td class="LightWalkDataTD">
<select name="s_order_id">
<option value="">Select Value</option>
{s_order_id_Options}
</select>
</td>
<!-- END BlockName -->
- create form Before Show event. There you should catch the number which indicates how many listboxes you want to show. Once it is done, to duplicate the listbox use following code:
PHP
$number_of_controls = 3;
global $Tpl;
global $<form_name>;
for ($i = 0; $i<$number_of_controls; $i++)
{
$<form_name>->s_order_id->Show();
$Tpl->parse("BlockName", true);
}
|
|
|
 |
|