Page 1 of 1

php array show/hide function: PLEASE HELP ME!

Posted: Tue Dec 28, 2010 4:50 pm
by phphelpme
Hi, I have an array that produces a list of names taken from a php file and these are loaded into an array, then the array shows names in blocks of 5. Like group 1, group 2 etc.

I currently have it showing all groups when you load the page and I was wondering if I could get it to only display the group when you click a link or image. This way you dont have to keep scrolling down to get to a certain group number.

For instance, it currently displays:

Group 1
name
name
name
name
name

Group 2
name
name
name
name

What I want is this:

Group 1 (show)

Group 2 (show)

Group 3 (show)

Then when show is clicked it shows that group only. Like a hidden atribute but when I tried it using java they did not open.

The below code is the code just showing them all at the same time.
Any help would be great.

Many thanks

Re: php array show/hide function: PLEASE HELP ME!

Posted: Tue Dec 28, 2010 4:57 pm
by anantha
it can be done using javascript...

Re: php array show/hide function: PLEASE HELP ME!

Posted: Tue Dec 28, 2010 5:03 pm
by phphelpme
Hello Anantha,

Thank you for your reply, but I am not sure how to perform this action because I tried using this:
But I just get a list of expand(s) and nothing works. Can you suggest anything?

Best wishes

Re: php array show/hide function: PLEASE HELP ME!

Posted: Wed Dec 29, 2010 5:09 am
by phphelpme
All sorted, I needed to rearrange some of my php script in order to allow my hidden div to function correctly using javascript.

Thanks for any suggestions.

Best wishes.