Click to See Complete Forum and Search --> : Hide or Show Tables In PHP
FarOdyssey
12-06-2005, 06:16 PM
Anyone know how to hide or show a table when a user clicks on a link with PHP? I can't seem to find an example of what i'm talking about, but basicly I have a page with a long list of tables and i'd like to have the user be able to click a "x" at the top of a table and have it colapse to just it's header. Then, when the user clicks the "x" again, it would come back up. It's ok if the page has to reload.
any ideas?
i've been searching for applets and things everywhere (not just PHP) and i can't seem to find it.
ecsyle
12-06-2005, 08:48 PM
Perhaps use javascript instead?
using PHP would requrie the page to refresh, whereas javascript wouldn't. It would make the process of actually closing the table more seamless to the user.
However, you could use some simple conditional logic
$collapse=(isset($_GET['collapse']) && $_GET['collapse']==true)?true:false;
if($collapse){
//no table
}else{
//print table here
}
<a href="?collapse=true">X</a>
Something like that
JPnyc
12-06-2005, 09:21 PM
Correct, javascript is what you use for this, not a serverside lanaguage. How many tables are there and do you want to hide/show them all?
FarOdyssey
12-07-2005, 04:58 PM
there's multiple tables. basicly it's a site where i post up projects for various designers and they can upload materials and see schedules, etc. the part i'm asking about is just a series of tables one after the other. each one a different project. i'd like for them to be able to "minimize" any one table they want to and for the page to remember this. each designer has a seperate page they go to so we don't need db or anything like that unless we do and i'm an idiot.
anyway, i have no programming experience and i'm just a designer myself so i'm not sure i'm going to get this done. i surfed a couple of applet sites but couldn't really find what i was looking for...
Try google. I have had a hard time finding these types of scripts on the applet sites myself, but I've found a few on google. Search "hide and show javascript" or something along those lines. I found an awesome one on a javascript/IT forum awhile ago, I wish I had it bookmarked.
ecsyle
12-07-2005, 06:12 PM
http://www.dyn-web.com/dhtml/show-hide/
FarOdyssey
12-07-2005, 07:21 PM
this is just what i was looking for, thanks for all your suggestions
JPnyc
12-07-2005, 07:50 PM
For the record, applets are Java, not javascript.