Hola a todos!
Tengo este codigo para dos combos enlazados....
<%'CONSULTA PARA OBTENER LOS DATOS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("loquesea")
productos_Sql = "SELECT * FROM Subsectores"
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("Cod_Sector"))&" "&(rs("Cod_Sub")) %>";
subcatagoryof = "<%=(rs("Nom_Ct"))%>";
subcatagoryid = "<%=(rs("Nom_Cs"))%>";
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 * FROM Sectores"
rs.Open familias_Sql, Conn
do while not rs.eof
%>
<option value="<%=rs("Cod_Sector")%>"><%=rs("Nom_Cs")%></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>
....y me dice q se requiere un objeto, teniendo en cuenta q he copiado el codigo y no se javascript....alguien ve x donde falla?