Jump to content


Photo

Multiple dropdown boxes


  • Please log in to reply
1 reply to this topic

#1 seabee1982

seabee1982

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 22 January 2013 - 04:10 PM

I have seen numerous topics outlining cascading multiple dropdown boxes, however, I'm having trouble coming up with a solution to a similar, but different, problem.

I'm trying to come up with a better way for a selection of a visitor's best 5 vacation states. Without a chance of duplicate selections.


I see 2 ways to handle this:

1. Use php/html to populate the dropdowns from the MySQL db table 'states' (5 times). Currently the way I have it set up.

2. Use AJAX to remove the selections in the previous dropdowns (preferred). This eliminates duplicate selections.

The first dropdown would populate from a MySQL db table 'states'.

The second dropdown would populate from the db and eliminate the first selection.

The third dropdown would popluate from the db and eliminated the first and second selections.

And so on.....


The problem is that the second dropdown is dependent on the selection of the first dropdown.
Has anyone come across a "Top 10" list that works the same way?
Or should I just verify selections in #1 against each other to prevent duplicate selections?

Edited by seabee1982, 22 January 2013 - 04:16 PM.


#2 Barand

Barand

    Sen . ( ile || sei )

  • Gurus
  • 14,423 posts
  • LocationCheshire, UK

Posted 28 January 2013 - 01:52 PM

Option 3. Build a JS array from the database when you create the page then as option 2 without the AJAX, just JS

moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
|baaSelect| generate js and php code for dynamic linked dropdowns

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com