Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2007, 09:02
nancy8120
 
Fecha de Ingreso: enero-2006
Mensajes: 233
Antigüedad: 19 años, 3 meses
Puntos: 2
como hacer un list box a partir de otro

hola
tengo en un form dos list box uno de categoria y otro de subcategoria, lo que quiero es que cuando seleciono una categorya en el listbox de la subcategory solo me salgan las subcateory de la categoria que selecione
yo tengo la idea pero no se como manipular el selected,
muestro el codigo:

<tr>
<td><strong>Category:</strong></td>
<td><select name="category" class="InputBoxText">
<%
strSQL = "SELECT idcategory,description FROM Category order by description"
Set rst = Conn.Execute(strSQL)
Do While Not rst.EOF
strSelected = "selected"
Response.Write "<option value="""&rst("idcategory")&""" "&strSelected&">"&rst("description")&"</option>"
rst.MoveNext
Loop
%>
</select></td> </tr>
<tr>
<td><strong>SubCategory:</strong></td>
<td><select name="subcategory" class="InputBoxText">
<%
strSQL = "SELECT idsubcategory,description FROM subCategory where idcategory="&rst("idcategory")&" order by description"
Set rst = Conn.Execute(strSQL)
Do While Not rst.EOF
'strSelected = ""
'If CInt(rst("")) = Cint() Then
' strSelected = "selected"
'End If
Response.Write "<option value="""&rst("idsubcategory")&""" "&strSelected&">"&rst("description")&"</option>"
rst.MoveNext
Loop
%>
</select></td></tr> <tr>

gracias
saludos