Pulp
|
| Posted: 07/24/2003, 6:56 AM |
|
Hello
I am working with CCS 2.0, and PHP+templates and I have a problem I can't manage to solve alone. I have an upload page, with different FileUpload elements. I would like some of these elements to be shown/hidden depending on parameters I pass to the page. The problem is that I dont want to show/hide FORMS but TABLES.
How can I do ? Templates ? Something else ? All that I read about templates wasn't enough to get it work...
Thanks
Pulp
|
|
|
 |
Pulp
|
| Posted: 07/24/2003, 7:32 AM |
|
Or at least a way to hide controls such as TextBox...
Pulp
|
|
|
 |
rrodgers
|
| Posted: 07/24/2003, 12:28 PM |
|
>>Or at least a way to hide controls such as TextBox...
Turn on the Extended HTML check box for that textbox. Search the help for "extended html" Pick the result "working with controls". About 1/2 way down the page is an image with the check box.
rob
|
|
|
 |
ceinj
|
| Posted: 07/24/2003, 1:48 PM |
|
Here is a trick I just learned the other day...
To hide an element set its "Style" to "display: none". To control this at run time (and you are using CCS to generate) and code in the "Before Show" event to set this attribute on the desired element.
If this works for you I'd appreciate a short note saying so (ceinj@aol.com)
|
|
|
 |
Pulp
|
| Posted: 07/25/2003, 1:38 AM |
|
Thank you all for this help. Here's how I made thing work :
I managed to hide a TABLE for example (or any HTML element) this way :
Note : this code is for PHP, for a TABLE in a record name "Record1", but you shouldn't need a record to make it work.
1. Surround the element to hide with two Labels, named for example "BeginMask1" and "EndMask1", and set them this way :
"Control source type" -> "Code Expression"
"Content" -> "HTML"
2. Add a "Custom code" Before Show event to you record "Record"
global $Record;
global $condition_to_hide;
if ($condition_to_hide)
{
$Record->BeginMask1->SetText("<table style=\"display: none\"><tr><td>");
$Record->EndMask1->SetText ("</td></tr></table>");
}
else
{
$Record->BeginMask1->SetText("<table>");
$Record->EndMask1->SetText ("</table>");
}
... and that's all. It works fine.
I'm not sure it's the most secure though... but it helps ;)
Pulp
|
|
|
 |