Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Divs and multiple select form elements

Status
Not open for further replies.

tmcneil

Technical User
Joined
Nov 17, 2000
Messages
294
Location
US
Is it possible to have a div inside a multiple select list box? I'd like to place rows of data inside the box that the user will select for aesthetics. Something like this:

<div class="scrollTable" id="testScrollTable" style="height: 200; width: 908;">
<span class="scrollTableHead">
<table cellspacing="0" frame="border">
<tr>
<td width="50"><nobr>&nbsp;Station ID</nobr></td>
<td width="100"><nobr>&nbsp;Station Name</nobr></td>
<td width="100%"><nobr>&nbsp;</nobr></td>
<td></td>
</tr>
</table>
</span>
<span id="sTable" class="scrollTableBody">
<table cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
<%
Set cn = GetDBConnection()
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
SQLStmt.CommandText = "select id, name from station_groups order by id"
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = cn
RS.Open SQLStmt

count = 0
Do While Not RS.EOF
IF CInt(selid) = CInt(RS("id")) OR CInt(selid) = -1 THEN
selid = RS("id")
pos = count
selname = RS("name")
END IF
%>
<tr ID="trItem[<%=count%>]" height="20" <% IF CInt(selid) = CInt(RS("id")) THEN %> class="selitem"<% ELSE %>class="item"<% END IF %> onClick="ItemClick(this);">
<input type="hidden" name="group[<%=count%>]" value="<%=RS("id")%>">
<td class="frowdata" width="50" nowrap>&nbsp;<%=RS("id")%></td>
<td class="lrowdata" width="100" nowrap>&nbsp;<%=RS("name")%></td>
<td class="ritem" width="100%" nowrap>&nbsp;</td>
</tr>
<%
count = count + 1
RS.MoveNext
Loop
RS.Close
%>
<%
FOR row = count to 7 %>
<tr class="item" height="20">
<td class="frowdata" width="50" nowrap>&nbsp;</td>
<td class="lrowdata" width="100" nowrap>&nbsp;</td>
<td class="ritem" width="100%" nowrap>&nbsp;</td>
</tr>
<% NEXT %>
</table>
</span>
</div>

Thanks in advance,
Todd
 
Not sure what that code is doing, but I am sure that you cannot have a div inside a select tag. Something you can have is the following:
Code:
<select multiple name="s">
  <optgroup label="Here's Some Stuff">
    <option>Stuff 1</option>
    <option>Stuff 2</option>
    <option>Stuff 3</option>
  </optgroup>
  <optgroup label="Here's Some More Stuff">
    <option>Stuff 4</option>
    <option>Stuff 5</option>
    <option>Stuff 6</option>
  </optgroup>
</select>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top