SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member cartic's Avatar
    Join Date
    Jul 2003
    Location
    Sunny California
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question dynamic drop down menu

    Hi,
    i would like to know how to build a dynamic drop-down menu. Let me explain what i want.
    There are 3 categories A,B,C which are present in drop-down1. When a use selects category A, it must show the child elements of A, namely A1, A2, A3,..
    Same thing for selection B and C.
    I know that this can be done using javascript entirely, but i dont think it will be compatible across all browsers. is there some other way to do this in php, using server code only.

    Thanks

  2. #2
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are seeking to have a select menu updated when another select is chosen without reloading the whole script then you will need to use javascript. PHP is server side so when something is selected on the clientside it has no way of knowing without reparsing the script with the new info.

  3. #3
    SitePoint Member cartic's Avatar
    Join Date
    Jul 2003
    Location
    Sunny California
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jump
    If you are seeking to have a select menu updated when another select is chosen without reloading the whole script then you will need to use javascript. PHP is server side so when something is selected on the clientside it has no way of knowing without reparsing the script with the new info.
    I was thinking submitting the form using javascript and then populating the child dropdown with the values from an array or somethign. The main point is that i dont want to use too much of javascript which older browsers will not understand.
    If im thinking correctly, a simple "on select form submit" javascript script should work in all browsers.
    Correct me if im wrong.

    Thanks

  4. #4
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should. Not too many peeps using old browsers anymore would be my guess. I really don't have too much sympathy for the "old browser" crowd anyway. It's time they got Firefox anyway.

  5. #5
    SitePoint Member cartic's Avatar
    Join Date
    Jul 2003
    Location
    Sunny California
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I havent used much of firefox, (i just downloaded a copy recently). does firefox have any javascript compatibility issues? Or is all that javascript compatibility stuff a thing of the NS 4 era?

  6. #6
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have had no js problems with todays browsers. I ussually test with IE, Mozilla, Firefox, and Opera.

  7. #7
    SitePoint Member cartic's Avatar
    Join Date
    Jul 2003
    Location
    Sunny California
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jump
    I have had no js problems with todays browsers. I ussually test with IE, Mozilla, Firefox, and Opera.
    thanks for your help

  8. #8
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can anyone point me to a tutorial which explains how to do that with javascript?


Bookmarks

Posting Permissions

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