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 -> General/Other

 How to hide static text with embedded controls?

Print topic Send  topic

Author Message
dhempy


Posts: 40
Posted: 07/08/2004, 1:33 AM


I'm trying to hide a paragraph on a record page, based on a field in the database. The paragraph has some static text, and several fields from my Band table.

It's a pretty standard page, dumping most of the fields for one record to the page. If the band has a website, I want to show:

<p>Visit {bnd_name}'s web site: <a href="{bnd_url}">{bnd_url}</a> </p>

If they don't have a website, I want that whole sentence to disappear, but of course I still want to show all the other stuff on the page (band description, band name, etc.)

I've found how to hide controls using an event that sets the visible attribute for the control. That seems simple enough, except that seems to only work on discreet controls. I think my problem is that I don't know how to make a control that is a sentence of static text with a several fields in it. I've tried using labels and links, but I can't get them to include the whole sentence surrounding the link...only the field or link itself. I'm not trying to hide a whole row or record, so that's not it either.

Can anyone point me in the right direction? I sure could use it! :-)

-dave


ps. Here is the page as I've currently got it:

<!-- BEGIN Record band -->
<form method="post" action="{Action}" name="{HTMLFormName}">
<h1>{bnd_name}</h1>

<h2>{bnd_blurb}</h2>
<!-- BEGIN Error -->
<p>{Error} </p>
<!-- END Error -->
<hr>
<p>{bnd_description}</p>

<hr>

=== This next paragraph is the part I want to hide if bnd_url is empty: ===
=== This next paragraph is the part I want to hide if bnd_url is empty: ===
=== This next paragraph is the part I want to hide if bnd_url is empty: ===

<p>Visit {bnd_name}'s web site: <a href="{bnd_url}" target="_new">{bnd_url}</a> </p>


</form>
<!-- END Record band -->

_________________
David Hempy
Director of Broadcast and Education Technology
Kentucky Educational Television
800-333-9764
View profile  Send private message
peterr


Posts: 5971
Posted: 07/08/2004, 10:03 AM

Currently you cannot hide multiple controls at once. Instead, I'd use a Label and do the opposite: instead of hiding it, I would assign an HTML snippet to it only when needed. If you need to include simple controls within that text then you can assign control values to the label as well. For example in ASP:
RecordForm.Label1.Value = "Visit " & RecordForm.band_name.Value & "'s web site: <a href=""" & RecordForm.band_url.Value & """ target=""_new"">" & RecordForm.band_url.Value & "</a>"
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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