The Daily Click ::. Forums ::. Non-Klik Coding Help ::. Multiple list criteria selection
 

Post Reply  Post Oekaki 
 

Posted By Message

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  443096

VIP MemberLikes TDCKitty
15th January, 2011 at 02:59:49 -

Ok so basically I have 3 lists that are drop down lists and each consecutive menu is contextual to the one before it. Does this make sense?

It's for an online website to help students find resources for university admissions.

So basically list one the user selects what they want to be which open up list 2 of what the degree is called and then the 3rd list opens of what university offers that course...then they hit search and it has the information on that course from that university that opens in a seperate page.

Anyone have any ideas on how to do this?? Any help is hugely appreciated!

EDIT: an awesome example of what I mean: http://support.amd.com/us/Pages/AMDSupportHub.aspx
on the right panel where you can download drivers, the lists are contextual.

Edited by an Administrator

 
thinking is like pong, it's easy, but you miss sometimes.

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  67016

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 33 Winner!Picture Me This Round 32 Winner!Santa!Box Blue
18th January, 2011 at 20:37:07 -

They used javascript to do it on that site.

Why don't you just find a plugin for mootools or jquery that can do that instead of using mmf?


If you must use mmf...
Just find a way to store the lists and use a loop to populate each of the list objects when necessary.

You can store the list options in a sting object and seperate this using delimiters like this:

"degree1,degree2,degree3, ... : degree1,degree2,degree3, ..."

comma's separate items in the list, colon separates each list of degree types or whatever.

Use String Parser 2 object to get the data and put it in the list.

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore
http://www.rodentrush.com <- My best iphone game, made with Fusion.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1833

VIP Member
19th January, 2011 at 16:00:12 -

I think he's asking how to do it in javascript (or php or whatever) - that's why it's in the non-klik coding forum.

I'd probably try to do it using javascript to parse an xml file, but I'm a real beginner.
Something like this maybe:

<info>
<job>
<jobname>Web Designer</jobname>
<crs>IT</crs>
<crs>Graphics</crs>
</job>

<course>
<coursename>Graphics</coursename>
<uni>Oxford</uni>
<details>blah blah blah</details>
</course>

<course>
<coursename>IT</coursename>
<uni>Cambridge</uni>
<details>blah blah blah</details>
</course>
</info>


You'd start by listing all "jobname"s in one dropdown list.
When the user picks an option, it triggers a function which loads all "crs"s from the selected job. Picking an item from that list would then bring up a list of "uni"s to choose from. Picking a uni would then take you to a search results page (you'd need to pass the university and coursename as url parameters) which would then display the course details.

There's probably a better way to do it - but you'd be better off asking on a javascript forum.

 
n/a

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  443096

VIP MemberLikes TDCKitty
27th January, 2011 at 00:59:12 -

Thanks for the help. Yes I am looking to do it in any language really, but not MMF. I assumed I'd need to use XML and then another language to use the XML (however it does it). I'll keep looking around.

For a bit I figured it'd be easier to use flash, but I'm starting to think Java would be much easier....blargh



 
thinking is like pong, it's easy, but you miss sometimes.

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
10th February, 2011 at 07:54:10 -

Using PHP I would populate the dropdown lists using an AJAX callback. Quite simple really, all you ought to do is write a page that generates the dropdown list for you from a given selection like:

generateList2.php?sel1=...

generateList3.php?sel1=...&sel2=...


So you pass the selected item index or something from list 1 to the script in an AJAX callback. The page you query generates the html for the dropdown lists, and you just replace the contents of the list container with the new list.

That's my preferred method anyway, I don't like fiddling about with javascript to parse XML and so on, I like to keep all my data in a database, although it would be more responsive to load all the data in xml format at the start. You could always just generate a javascript list in PHP.

 
http://create-games.com/project.asp?id=1875 Image

   

Post Reply



 



Advertisement

Worth A Click