CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Simply hide the form if...

Print topic Send  topic

Author Message
Donna

Posts: 7
Posted: 09/22/2004, 7:49 AM

I know dlookup is not the best way to do this, but at this point, it doesn't matter.

I can't get it to work and can't, for the life of me, figure out why!

What is wrong with the following code? It is placed in the before show event of the named form... The variables are correct but it won't hide the form as it should.

$myBoardID = get_session("UserID");
$cap = dlookup("members", "stcaptain", "member_id=$myBoardID");
$webmtr = dlookup("members", "webmaster", "member_id=$myBoardID");
$tre = dlookup("members", "treasurer", "member_id=$myBoardID");
$sec = dlookup("members", "secretary", "member_id=$myBoardID");
$pres = dlookup("members", "president", "member_id=$myBoardID");
$vp = dlookup("members", "vicepresident", "member_id=$myBoardID");
//echo "web=$webmtr, cap=$cap, pres=$pres, vp=$vp, sec=$sec, tre=$tre";

if ($cap<>"Y" && $sec<>"Y" && $webmtr<>"Y" && $vp<>"Y" && $tre<>"Y" && $pres<>"Y") {
$tpl->set_var("FormBoard","");
//return; note- I also tried including this
}



Thanks!!!
View profile  Send private message
Donna

Posts: 7
Posted: 09/22/2004, 8:10 AM

Okay, I have it working but need to understand why my solution worked.

First of all, I moved the script to the from's open event. Still didn't work.

This worked...
I left the above script unaltered BUT I moved it to the top of the open event of a different form on this page (Webmaster).

So, I moved the script from Board.open event to Webmaster.open event.
Webmaster had some existing code to determine if it should be hidden or not and that code was working.

Are we not allowed to use open events on more than one form on a single page? If so, why?

Thanks!
View profile  Send private message
peterr


Posts: 5971
Posted: 09/22/2004, 9:02 AM

Donna,

CodeCharge Studio doesn't have "Open" events. Are you maybe using CodeCharge?
You can use multiple forms and open events in CodeCharge.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Donna

Posts: 7
Posted: 09/22/2004, 9:09 AM

Thank you Peter. Yes, I am using codecharge. I posted here because I thought this was a PHP issue rather than a codecharge issue. I didn't realize Studio didn't use the Open Event.

I'll post more appropriately next time.

Thanks again.
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.