Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    different sort of dropdown....

    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

    Thank you

  • #2
    New Coder
    Join Date
    Sep 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Uhh..I used to that all the time. Trying to remember how..if I remember I'll be sure to let ya know.

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx...

    is it in javascript or php?

  • #4
    New Coder
    Join Date
    Sep 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think it was php..but if it is java then i'll edit it to be php

  • #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Regular Coder
    Join Date
    Jan 2004
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #7
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    Regular Coder
    Join Date
    Jan 2004
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx...ill do that....

  • #9
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by grudz
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •