Ver Mensaje Individual
  #9 (permalink)  
Antiguo 31/05/2007, 19:14
strike20
 
Fecha de Ingreso: septiembre-2004
Mensajes: 50
Antigüedad: 20 años, 7 meses
Puntos: 0
Re: combo a condicion

gracias amigazo....mira tb hice unas modificaciones y si me di cuenta de ese temp, mira aqui te dejo lo q hice y las modificaciones

Cita:
<%@LANGUAGE= "VBScript" %>
<!-- #include file="db.inc" -->
<%v=request.QueryString("var")%>

<HTML>
<head>

</head>
<BODY>
<FORM name="frm">
<p>
<label>
<input name="A" type="text" id="A" onBlur="horas(document.forms.frm.A.value);">
</label>
</p>
<p>
<label>
<input name="B" type="text" id="B">
</label>
</p>
<p>
</p>
<p>
<%
dim H_libres()
dim H_ocupadas()
set rs=server.CreateObject("adodb.recordset")
sql="SELECT HORA FROM dbo.HORAS WHERE ESTADO='1'"
rs.ActiveConnection = db
rs.Open SQL
i=0
while not rs.eof
redim preserve H_libres(i)
H_libres(i)=rs("hora").value
i=i+1
rs.movenext
wend
rs.close
set rs=nothing
%>
<%
if v<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="SELECT HORA FROM dbo.CITA WHERE (FECHA = '"& v &"')"
rs.ActiveConnection = db
rs.Open SQL
a=0
if rs.eof then
redim preserve H_ocupadas(a)
H_ocupadas(a)="basura"
else
while not rs.eof
redim preserve H_ocupadas(a)
H_ocupadas(a)=rs("hora").value
a=a+1
rs.movenext
wend
end if
rs.close
set rs=nothing
else
redim preserve H_ocupadas(0)
H_ocupadas(0)="basura"
end if
%>
<%
response.Write "<select id=libres>"
temp=0
for i=0 to ubound(H_libres)
for j=0 to ubound(H_ocupadas)
if H_ocupadas(j)<>H_libres(i) then
temp=temp+1
else
j=ubound(H_ocupadas)+2
end if
if temp=ubound(H_ocupadas)+1 then
response.Write "<option value="&H_libres(i)&">"&H_libres(i)&"</option>"
temp=0
end if
next
temp=0
next

response.Write "</select>"

%>
</p>
</FORM>
<script language="javascript1.2" type="text/javascript">
function horas(variable)
{
segundos=0;

//setTimeout('document.location.href="2.asp?var='+va riable+'";',segundos);
frm.B.value=variable;
}

</script>
</BODY>
</HTML>
GRACIAS AMIGO......epseor volver con mas inquietudes y me dsepas ayudar como siempre nos vemos