0

I'm using PHP to pull from a MySQL table then populate an XML for the javascript to get that information.

Table results example shown here Select

I want to make a dropdown menu the the hobbienames then when that selection is made another menu to appear with the hsnames that match the hobbiename. obviously if null nothing will appear.

2 Answers 2

1

If the first dropdown is not very lengthy, and has a fixed length, then you can retrieve all the possible dropdowns and hide them initially.. On selection of an item from dropdown1 you can then display its corresponding dropdown.

In the other case, if the first dropdown is lengthy, then on its selection, run an AJAX function which will eventually populate the other dropdown.

Sign up to request clarification or add additional context in comments.

2 Comments

how lengthy is lengthy? right now its like 25 things, it could one day be more towards 100s
so that means 25 different possible dropdown list collections for each selection. If it is very expensive for you to get all of these collection when the page loads, then do not do it. Make an AJAX call on the first dropdown list to generate the 2nd dropdown list. Then in future when it becomes 100s, it should work fine.
0

Here's a sample code which you can use as reference...

http://theitbranch.com/transfer/country.zip

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.