php array show/hide function: PLEASE HELP ME!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

php array show/hide function: PLEASE HELP ME!

Post 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
Last edited by phphelpme on Wed Dec 29, 2010 5:08 am, edited 1 time in total.
anantha
Forum Commoner
Posts: 59
Joined: Thu Dec 23, 2010 7:38 pm

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

Post by anantha »

it can be done using javascript...
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

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

Post 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
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

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

Post 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.
Post Reply