CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Dynamically Hide Fields

Print topic Send  topic

Author Message
Tom
Posted: 04/03/2002, 11:16 AM

Hello,

What is the best way in php to show/hide a field depending on a value selected from a mysql database?

For example:

There is a MySQL DB named Items.
One of the fields is named ShowHide, which can have a value of either 0 or 1, and one field named Description1 and one field named Description2.

If the value of ShowHide = 0 then I would like to show field Description1 and hide field Description2 from the user.

Does CodeCharge allow for this?
Alex Alexapolsky
Posted: 04/03/2002, 11:29 AM

You can create a few forms with some fields hidden some not
and then hide needless forms
Tom
Posted: 04/03/2002, 2:24 PM

Tomasz
Posted: 04/05/2002, 1:44 AM

but remember this is a 'brute force' method;-)
your php file will be at least 50% bigger.
if you have form with many fields ans more than one condition to hide, it's not a good idea
Nicole
Posted: 04/05/2002, 2:07 AM

Tom,
the ther way is to hide fields. Add description1 and description2 as Hidden fields and one Label field need to display one of description fields. In Before Show event check the value of showhide field and depending on its value assign description1 or description2 field to Label type field.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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