
16/11/2005, 17:39
|
| | Fecha de Ingreso: octubre-2004 Ubicación: Venezuela
Mensajes: 111
Antigüedad: 20 años, 5 meses Puntos: 0 | |
Ahora lo coloque asi, pero igual no hace nada de efecto en el 2do combox
<script language = "JavaScript">
<%'CONSULTA PARA OBTENER LOS DATOS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\base_datos.mdb"))
productos_Sql = "Select distinct titulo from contenido" 'consulta 2d0 combobox
set rs = CreateObject("ADODB.Recordset")
rs.Open productos_Sql, Conn
x=0
%>
// FUNCION DE COMBO BOX COMBINADO
function sublist(inform, selecteditem)
{
inform.subcatagory.length = 0
<%
count= 0
y=0
do while not rs.eof
%>
x = <%= trim(y) %>;
subcat = new Array();
subcatagorys = "<%=rs("titulo")%>";
subcatagoryof = "<%=rs("titulo")%>";
subcatagoryid = "<%=rs("titulo")%>";
subcat[x,0] = subcatagorys;
subcat[x,1] = subcatagoryof;
subcat[x,2] = subcatagoryid;
if (subcat[x,1] == selecteditem) {
var option<%= trim(count) %> = new Option(subcat[x,0], subcat[x,2]);
inform.subcatagory.options[inform.subcatagory.length]=option<%= trim(count)%>;
}
<%
count = count + 1
y = y + 1
rs.movenext
loop
rs.close
%>
}
</script>
</head>
<body bgcolor="#CDB1B7">
<h2 align="center"><b><i><font color="#AE1732"><u>Combo-box enlazados </u></font></i></b></h2>
<form name="prueba">
<div align="center">
<center>
<table border="0" width="80%">
<tr>
<td width="77%">
<select size="1" id="familia" name="familia" onChange = "javascript:sublist(this.form, familia.value);">
<option selected>Selecciona una familia</option>
<%familias_Sql = "Select distinct nombre_curso from contenido"
rs.Open familias_Sql, Conn
do while not rs.eof
%>
<option value="<%=rs("nombre_curso")%>"><%=rs("nombre_curs o")%></option>
<%rs.movenext
loop
set rs=nothing
conn.close
set conn=nothing%>
</select> & nbsp; <SELECT id="subcatagory"
name="subcatagory" size="1">
<Option selected value="none"></option>
</SELECT></td>
<td width="9%">
<p align="left">
</p>
</td>
</tr>
</table>
</center>
</div>
<center>
</form>
</center>
</body>
</html>
__________________ Has resucitado mi :corazon: que estaba muerto y sin salvación |