• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Dynamic list/menu's

Hi

I am using two dynamic list/menu's on one page. The first is a dynamic menu from a DB table called Team and its lists all the different names of teams in my database. My database is relational and I have another table called Team_Members whoch is attached to My Team. Each TeamMember can have one Team but a Team can have many members. When i select the team i want from the drop down menu i would like all the members of that team to appear in the menu/list below. Does anyone know how i should do this?

Thanks
0
andyb1
Asked:
andyb1
  • 5
  • 3
1 Solution
 
vickerleungCommented:
andyb1,

Brief idea right here.

First you pass out all the team members and team names to the page. (i.e. ASP / JSP / PHP)

And then using javascript array to store all these variables.

Create the first team name list (I think you know how to do this one)

Add a javascript action that when the dynamic list is changed, then it will recreate the whole team member list based on the array data.

Vicker
0
 
andyb1Author Commented:
I get the idea of what you are saying but, do u mean store the the info in a recordset and i don't know how to add a javascript action to re-create the 2nd list when the first list selection is made.

Andy
0
 
andyb1Author Commented:
anyone there?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
rockmansatticCommented:
You can also do this.
Have the first dropdownbox in a seperate form as the second.
Have it submit to the same page via GET(automatically if preferred)
Set the second recordset to obtain the search criteria from the url (i.e. results.asp?team=indians)

This way, when the page is first loaded, the first DDBox is filled from the first Recodset
and since there is no parameters in the url at this point, you can have that dropdown box not show.(show if recordset is not empty)
Then the first DDBox is submitted, the url is full and t he second recordset can now populate.

Rockman
0
 
andyb1Author Commented:
ok cheers. How do i get the first list/menu to reload the page straight after selection as opposed to me having to use a submit button. I could have used the go-to list but the my first list is also dynamic.

Cheers
0
 
rockmansatticCommented:
DW has the built in capibilities of a "jump Menu" which uses javascript to automatically submit on change.
or yo could build your own javascrit submit something like:

onchange="this.form.submit();"

Rockman
0
 
andyb1Author Commented:
"jump Menu"

I dont think these can be dynamic correct me if im wrong?
0
 
rockmansatticCommented:
Sorry, your correct.  They CAN be but they do take a little codeing.
Best just to put

onchange="this.form.submit();"

in the select tag.

Let me know if this works for you.
Rockman
0
 
andyb1Author Commented:
Thanks very much ill try it!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now