...

View Full Version : different sort of dropdown....



grudz
09-06-2005, 05:58 PM
Hi,

I don't really know how to explain this, but here it goes....

I would like 1 dropdown box that'll show information, and when you select one of them, depending on which one you select, other selections appear in a sort of drop down next to it.

I tried to find a site that has that, but I couldn't think of any off the top of my head.

link (http://www.dkaygraphix.com/dropdown/dropdown.jpg)

Thank you

crazykilla
09-06-2005, 06:26 PM
Uhh..I used to that all the time. Trying to remember how..if I remember I'll be sure to let ya know.

grudz
09-06-2005, 06:45 PM
thanx...

is it in javascript or php?

crazykilla
09-06-2005, 07:46 PM
I think it was php..but if it is java then i'll edit it to be php

missing-score
09-07-2005, 03:57 AM
If you mean when you move your mouse over it, something else appears, the it would only be JavaScript or some very clever CSS (eg: http://www.udm4.com). If you just mean that after selecting one set of options, the page re-loads with another set then thats different (but entirely do-able).

Post back here and let us know, It sounds more like you want a dynamic menu with Javascript/CSS in which case this wouldnt involve much PHP.

grudz
09-07-2005, 03:44 PM
Yeah, it's like the site you showed me, like that, but the inital button is a dropdown. It would be very preferable (and easier for me) if the content would be database-driven, so if there's a way to use javascript for the dropdowns and PHP for the content of them, that would be great.....

Thank you

delinear
09-07-2005, 04:36 PM
You can do this with an onchange event handler that fires when someone selects an option from your drop down menu. How you display the next menu along depends on your requirements but as has been mentioned, this is javascript anyway so you'd be better off asking in the javascript forum how best to achieve this or look for a ready made solution.

Populating your javascript menus from your database using PHP is pretty straightforward, but before you play around with that I'd figure out the javascript side of things first then post back if you need help with the PHP side of things.

grudz
09-07-2005, 06:19 PM
thanx...ill do that....

Pro3110
09-07-2005, 09:27 PM
Yeah, it's like the site you showed me, like that, but the inital button is a dropdown. It would be very preferable (and easier for me) if the content would be database-driven, so if there's a way to use javascript for the dropdowns and PHP for the content of them, that would be great.....

Thank you

I couldn't see the link (got a DNS error). Based on what I've read, I think these are called "master_detail" type of forms. Your first pick produces a second list to pick from ect.

I don't know how to do them, but I've been told you could with php. I know that in HTML you can disable form controls by setting them to
DISABLE or READ ONLY. So I think that might be the key. Somehow setting the second drop down to DISABLE until the first dropdown has produced a choice.

Anyway...I'm wildly speculating. Let me us know what you find out. Master forms are really useful and being able to do them in PHP is more relaible than javascript as some users have javascripting turned off.

Page



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum