Multiple Select Menus

Discussion in 'PHP' started by circuscircus, Feb 17, 2007.

Thread Status:
Not open for further replies.
  1. #1
    http://imgodly.com/test.php

    I need it so if I select a color from the first menu, the second menu gets unselected (not disabled)

    Likewise, if I select a color from the second menu, the first menu gets unselected

    How can I do this?
     
    circuscircus, Feb 17, 2007 IP
  2. Your Content

    Your Content Banned

    Messages:
    1,096
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your Content, Feb 17, 2007 IP
  3. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is a JavaScript question, you should ask in that forum - anyway, you need to do something like:
    <select name="id1" onChange="document.form.id2.value = '';">
    ...
    </select>
    
    <select name="id2" onChange="document.form.id1.value = '';">
    ...
    </select>
    Code (markup):
    or something like this, search Google for "select onChange"

    HTH, cheers :)
     
    picouli, Feb 18, 2007 IP
  4. designcode

    designcode Well-Known Member

    Messages:
    738
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    118
    #4
    
    <select name="id1" onChange="document.form.id2.selectedIndex = 0''>
    ...
    </select>
    
    <select name="id2" onChange="document.form.id1.selectedIndex = 0">
    ...
    </select>
    Code (markup):
    As usual not tested, but should work.
     
    designcode, Feb 18, 2007 IP
  5. Your Content

    Your Content Banned

    Messages:
    1,096
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #5
    At least for me it's always interesting learn more.

    I have never tried a function like this before :)
     
    Your Content, Feb 19, 2007 IP
Thread Status:
Not open for further replies.