dale
|
| Posted: 07/15/2002, 3:19 PM |
|
I have two listboxes on a page but some of my pages only need one.
How can I keep the second listbox from showing if the database has no value for it?
Using PHP 4 with templates.
Thanks
Dale
|
|
|
 |
Nicole
|
| Posted: 07/16/2002, 7:55 AM |
|
Dale,
to hide one of the fields on the form follow the steps:
1. open html editor, find the table row or cell where the field is displayed, e.g.:
<td class="LightWalkDataTD">
<select name="s_order_id">
<option value="">Select Value</option>
{s_order_id_Options}
</select>
</td>
and surround it with HTML comments:
<!-- BEGIN RT -->
<td class="LightWalkDataTD">
<select name="s_order_id">
<option value="">Select Value</option>
{s_order_id_Options}
</select>
</td>
<!-- END RT -->
Once it is done the field won't be displayed on the form.
2. to display it create from Before Show event like:
global $Tpl;
global $form_name;
$form_name->field_name->Show();
$Tpl->parse("RT", false);
|
|
|
 |
dale
|
| Posted: 07/16/2002, 5:55 PM |
|
The first part of what you described works great but I must be missing something. This part generates an error if the field should be shown:
global $Tpl;
global $form_name;
$form_name->field_name->Show();
$Tpl->parse("RT", false);
I think my ignorance is the problem. What should That part of the code be?
My form is named onepc, the listbox I'm trying to hide/show is named size2
Do I put the before show in the listbox or the page?
Thanks Nicole,
Dale<<<<<<<<<<<<<less than two weeks with PHP but trying!
|
|
|
 |
Nicole
|
| Posted: 07/17/2002, 6:35 AM |
|
Dale,
just put the code into form Before Show event and replace "form_name" and "field_name" with real names.
|
|
|
 |
dale
|
| Posted: 07/17/2002, 7:17 PM |
|
When I put this code in the form onepc Before Show
I get this error:
Undefined index: /Grid onepc/RT in c:\inetpub\wwwroot\mysite\Template.php on line 155
I need this to show only if there's a value in the column for my second listbox.
I'm not sure what to do to get this working. It's too bad there's no documentation on the inner workings of Codecharge.
Can someone (Nicole) email me atdlute@neo.rr.com? :)
|
|
|
 |
Nicole
|
| Posted: 07/18/2002, 6:46 AM |
|
Dale,
1. make sure that template section names in html code in Parse() function are the same ("RT" in sample code);
2. please refer to CCS Programming Reference (the link is available at: http://www.codecharge.com/studio/panel/onlinedocs.html) for more information about CCS components, their properties, functions and methods
|
|
|
 |
funki
|
| Posted: 10/05/2002, 1:22 PM |
|
Okay i got the same problem. I made a grid . Changed the layout completely and everything looks just okiedo. The only problem is that IE gives me the following error:
Undefined index: /Grid bereidingstijd/Row in c:\inetpub\wwwroot\kookpagina\Template.php on line 170
I looked for it quite a while but can't seem to find it .
|
|
|
 |