Grouped Selection Boxes

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
jonhurlock
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Sep 11, 2005 1:34 am
Contact:

Grouped Selection Boxes

Post by jonhurlock » Fri Aug 24, 2007 10:37 am

I dont really know if this is the right place for this as it is NOT joomla specific. What I have is a A list of Cities, A list of Areas, and a List of Streets.

There are several cities, each with several areas, and each area has several streets. Now what I want to do is create three drop down menus 1 for cities, 1 for areas in that city and 1 for roads in that area.

What I want users to do is to be able to select a city which will then restrict the list of areas, so its specific to that city, the be able to pick an area, which will restrict the list of streets in that area.

Any idea how i could do this? Any help would be appreciated.

Regards,

Jon
Last edited by jonhurlock on Sat Aug 25, 2007 2:15 pm, edited 1 time in total.
:: Dont Insult, unless you can take insult! ::
Usefull links http://forge.joomla.org/sf/projects/accessible_joomla :: a8e Joomla
http://forum.joomla.org/index.php/board,151.0.html :: Welsh Forum

User avatar
seadap
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Mon Dec 04, 2006 12:22 am
Contact:

Re: Grouped Selection Boxes

Post by seadap » Fri Aug 24, 2007 4:02 pm

Sounds like this is a perfect question for the J!101 forum.  I'll bet there's someone hanging out there that could be of help.  I'll ask the mods to move this thread for ya.
Knowledge is realizing that the street is one-way, wisdom is looking both directions anyway.

User avatar
Dylan1968
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Nov 23, 2006 11:37 am
Location: 52°40N 5°13E (Netherlands)
Contact:

Re: Grouped Selection Boxes

Post by Dylan1968 » Fri Aug 24, 2007 4:18 pm

Hi Jon,

I don't have a specific idea on how to accomplish this, but my first guess 1) would be to look into AJAX. Research if you can use that.

If it's for registered (logged in) users, you might be able 2) to connect it to i.e. whatever they filled in themselves in their profiles (i.e. CB, forum profiles)

Both are just off the top of my head. Sorry I don't have the code for you... and maybe both options 1 and 2 are totally the wrong way to accomplish this.

Please keep us posted however. I have been playing with the idea of combining several 'sources' to be able to better target ads (or links). For now I simply lack(ed) the time to ully research this, let alone code it... but here's what I had in mind. Lots of 'keywords/ad logic' can be taken from either whatever the browser (IP=location) or some stats module tells me, or from where (Section/category) in the site they are. An example. If I know their location (browser or stats) I can target the ads accordingly. That's not a biggie. Second, if I have Section/categories worked out well, I could do specific ad (or other) targeting based on where in the site they are. Let's say I have a business directory which I categorized into types of business. Now if they are looking at business of type A, then target the ads that are relevant to that kind of business. Now I'd like to combine these two things, to better target ads. More revenue since it's better targeted.

Now if you can combine these two things, you'll have even better context-relative advertising. But there's some things software could never tell you. I haven't yet encountered some software that can tell me whether a page visitor is male or female or what age range they  are in, to name just two things. Now if it is (partly) a community site, they might have a profile where they have given me such information... if they filled in their profile fields.

Of course this does not necessarily have to be used for advertising. You can build your context menu's on this, or simply show those links at top that are more interesting for males aged 20-35, living in Wales (for instance ;)) and that are reading something in the section\category on cars instead of boats.... The end user may also profit from this.

Scenarios along these lines... but unfortunately I for now lack the time. Just too busy designing sites for my clients.

Good luck though with your City/areas/streets idea. It does sound like the smart thing to do and will definitely benefit both you and the website visitors.

P.s. Maybe both option 1 and 2 are totally wrong for you. This is just my first hunch.
Greets, fare meaning Sail… well, Dylan
"I'm just an old chunk of coal, but I'm gonna be a diamond someday" (Billy Joe Shaver)
Digitalenknobbel.nl

User avatar
jonhurlock
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Sep 11, 2005 1:34 am
Contact:

Re: Grouped Selection Boxes

Post by jonhurlock » Fri Aug 24, 2007 4:18 pm

Seadap thanks for the move, i would just like to point out that this is not for a joomla site, its another site I am working on currently.

Dylan, ajax seems like the most sensible way. I was just wondering if anyone knew of any code snippets, which i could possibly take a look at and possible modify to suit my need.
Last edited by jonhurlock on Fri Aug 24, 2007 4:22 pm, edited 1 time in total.
:: Dont Insult, unless you can take insult! ::
Usefull links http://forge.joomla.org/sf/projects/accessible_joomla :: a8e Joomla
http://forum.joomla.org/index.php/board,151.0.html :: Welsh Forum

unixboymd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 113
Joined: Thu Aug 18, 2005 5:53 pm
Location: Washington D.C. & Baltimore, MD Metro
Contact:

Re: Grouped Selection Boxes

Post by unixboymd » Fri Aug 24, 2007 5:57 pm

What you're looking for is called "chained selects".

This may help get you started. http://dynamicdrive.com/dynamicindex16/chainedselects/index.htm
Patience is something you admire in the driver behind you, but not in one ahead. -- Bill Mcglashen

User avatar
tjay
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Thu Aug 18, 2005 1:50 am
Location: New Orleans
Contact:

Re: Grouped Selection Boxes

Post by tjay » Fri Aug 24, 2007 6:16 pm

Wow that is a very cool and useful tool
thanks for the link
This day it is my wish that I helped you to live

User avatar
jonhurlock
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Sep 11, 2005 1:34 am
Contact:

Re: Grouped Selection Boxes

Post by jonhurlock » Sat Aug 25, 2007 2:14 pm

Thanks Unixboymd! That was exactly what i was looking for :D
:: Dont Insult, unless you can take insult! ::
Usefull links http://forge.joomla.org/sf/projects/accessible_joomla :: a8e Joomla
http://forum.joomla.org/index.php/board,151.0.html :: Welsh Forum

User avatar
Dylan1968
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Nov 23, 2006 11:37 am
Location: 52°40N 5°13E (Netherlands)
Contact:

Re: Grouped Selection Boxes

Post by Dylan1968 » Sat Aug 25, 2007 2:28 pm

Unixboymd: thanks for the tip. I had a look as well. And a very useful tool indeed. Cool!

Jonhurlock: Please keep us posted. I'd love to see it in action on your site.
Greets, fare meaning Sail… well, Dylan
"I'm just an old chunk of coal, but I'm gonna be a diamond someday" (Billy Joe Shaver)
Digitalenknobbel.nl


Post Reply