SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Assigning select value's to multiple select drop down from data base.

    Trying to assign values to multiple select drop down menu. I want each value to be selected in drop down supplied from data base.

    <td width="216" align="right">Registering as &nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td width="198"><select size="4" name="mutalenttype" multiple>
    <option value="<%=rs("mutalenttype")%>" selected><%=rs("mutalenttype")%></option>
    <option value="Composer">Composer</option>
    <option value="Conductor">Conductor</option>
    <option value="DJ">DJ</option>
    <option value="Lyricist">Lyricist</option>
    <option value="Player">Player</option>
    <option value="Singer">Singer</option>
    <option value="Song Writer">Song Writer</option>
    <option value="Sound Man">Sound Man</option>
    <option value="Teacher">Teacher</option>
    </select></td>

    Output to drop down is:

    Composer,conductor,DJ,Lyricist

    What I want is:

    Composer
    conductor
    DJ
    Lyricist


    <option value="Composer"<selected>Composer</option>
    <option value="Conductor"><selected>Conductor</option>
    <option value="DJ"><selected>DJ</option>
    <option value="Lyricist"><selected>Lyricist</option>
    <option value="Player">Player</option>
    <option value="Singer">Singer</option>
    <option value="Song Writer">Song Writer</option>
    <option value="Sound Man">Sound Man</option>
    <option value="Teacher">Teacher</option>

    Thanks

  2. #2
    SitePoint Member
    Join Date
    May 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found that this works, but if you have multiple select box's it could get messy.

    <%
    Dim strtest,intfound
    strtest=rs("mutalenttype")
    intfound = instr(strtest,"DJ")
    if intfound>0 then
    End if
    %>
    <td width="216" align="right">Registering as &nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td width="198"><select size="4" name="mutalenttype" multiple>
    <option>Multiple Select</option>
    <option value="Composer"<%intfound = instr(strtest,"Composer")
    if intfound>0 then
    response.write("selected")
    end if%>>Composer</option>
    <option value="Conductor"<%intfound = instr(strtest,"Conductor")
    if intfound>0 then
    response.write("selected")
    end if%>>Conductor</option>
    <option value="DJ"<%intfound = instr(strtest,"DJ")
    if intfound>0 then
    response.write("selected")
    end if%>>DJ</option>
    <option value="Lyricist"<%intfound = instr(strtest,"Lyricist")
    if intfound>0 then
    response.write("selected")
    end if%>>Lyricist</option>
    <option value="Player"<%intfound = instr(strtest,"Player")
    if intfound>0 then
    response.write("selected")
    end if%>>Player</option>
    <option value="Singer"<%intfound = instr(strtest,"Singer")
    if intfound>0 then
    response.write("selected")
    end if%>>Singer</option>
    <option value="Song Writer"<%intfound = instr(strtest,"Song Writer")
    if intfound>0 then
    response.write("selected")
    end if%>>Song Writer</option>
    <option value="Sound Man"<%intfound = instr(strtest,"Sound Man")
    if intfound>0 then
    response.write("selected")
    end if%>>Sound Man</option>
    <option value="Teacher"<%intfound = instr(strtest,"Teacher")
    if intfound>0 then
    response.write("selected")
    end if%>>Teacher</option>
    </select></td>


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
  •