Código HTML:
<!--#include file="../Connections/acceso.asp" --> <head> <title></title> <script language="javascript"> function ComponerLista(xPro) { document.forms.frmDatos.selCiudades.disabled = true; document.forms.frmDatos.selPropiedades.length = 0; CargarPropiedades(xPro); document.forms.frmDatos.selCiudades.disabled = false; } function CargarPropiedades(xCiu) { var o document.forms.frmDatos.selPropiedades.disabled=true; <% ' aca es donde no logro que reciba ni que genere la lista ' Set SelectII = Server.CreateObject("ADODB.Recordset") SelectII.ActiveConnection = MM_acceso_STRING SelectII.Source="SELECT DISTINCT SecondOp FROM TreeDatosFCR_index WHERe FirstOp ='"&selCiudades&"' ORDER BY SecondOp" SelectII.CursorType = 1 SelectII.CursorLocation = 2 SelectII.LockType = 1 SelectII.Open() while (NOT SelectII.EOF) %> o = document.createElement("OPTION"); o.text = <%=SelectII.Fields("SecondOp")%>; o.value = <%=SelectII.Fields("SecondOp")%>; document.forms.frmDatos.selPropiedades.options.add (o); <% SelectII.movenext() wend %> document.forms.frmDatos.selPropiedades.disabled=false; } </script> </head> <body> <form id="frmDatos" name="frmDatos" method="post" action=""> <!-- Genero la primera lista --> <select name="selCiudades" id="selCiudades" onChange="ComponerLista(document.forms.frmDatos.selCiudades[selectedIndex].value);"> <option>-- Select --</option> <% Set SelectI = Server.CreateObject("ADODB.Recordset") SelectI.ActiveConnection = MM_acceso_STRING SelectI.Source = "SELECT DISTINCT FirstOp FROM TreeDatosFCR_index order by FirstOp " SelectI.CursorType = 1 SelectI.CursorLocation = 2 SelectI.LockType = 1 SelectI.Open() while NOT SelectI.EOF %> <option value="<%=SelectI.Fields("FirstOp")%>"><%=SelectI.Fields("FirstOp")%></option> <% SelectI.movenext() Wend%> </select> <br> <!-- Segunda lista --> <select name="selPropiedades" id="selPropiedades"> </select> </form> </body> </html>