www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help with a selectbox value selection

  1. #1
    Join Date
    Jan 2006
    Posts
    96

    Help with a selectbox value selection

    Hi I have 2 select boxes and with multiple="multiple". at one time i want only one select box values to be slected. i.e when i select values in selectbox 1 selectbox 2 values should be diselected and vice versa.
    thnaks in advance

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    </head>
    <body>
    <SELECT NAME="names" multiple= "multiple" SIZE="10" WIDTH=150 id="names" >
    <OPTION value="Group1">chris</OPTION>
    <OPTION value="Group2">john</OPTION>
    <OPTION value="Group3">mat</OPTION>
    <OPTION value="Group4">hari</OPTION>
    <OPTION value="Group5">sam</OPTION>
    </select>
    <SELECT NAME="names2" SIZE="10" multiple= "multiple" WIDTH=150 id="names2" >
    <OPTION value="Group1">saly</OPTION>
    <OPTION value="Group2">peter</OPTION>
    <OPTION value="Group3">ram</OPTION>
    <OPTION value="Group4">ali</OPTION>
    <OPTION value="Group5">kumar</OPTION>
    </select>

    </body>
    </html>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <SELECT NAME="names" multiple= "multiple" onchange="document.forms['formName'].names2.selectedIndex=0;document.forms['formName'].names2.options[0].selected=false;" SIZE="10" WIDTH=150 id="names" >
    Similar expression also in 2nd select tag.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles