Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2005, 07:19
lreyesg007
 
Fecha de Ingreso: marzo-2005
Mensajes: 123
Antigüedad: 20 años, 1 mes
Puntos: 1
Combo y variable

Hola amigos :

Soy nuevo en esto y tengo el siguiente problema.
Quiero que cuando cambie un combo me guarde esto en una variable de tal forma que cuando vuelva a cargar el formulario la variable me permita saber si debo o no mostrar una <table>. Aca esta el codigo....


de antemano gracias

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ChileCompras.asp" -->


<%
Dim Rst_SolComp
Dim Rst_SolComp_numRows
Dim Rst_M_Proveedores
Dim Rst_M_Proveedores_numRows
Set Rst_SolComp = Server.CreateObject("ADODB.Recordset")
Rst_SolComp.ActiveConnection = MM_ChileCompras_STRING

strSQL = "SELECT * FROM E_SolCompra WHERE SC_Identif=1"
Rst_SolComp.Source = strSQL
Rst_SolComp.CursorType = 0
Rst_SolComp.CursorLocation = 2
Rst_SolComp.LockType = 1
Rst_SolComp.Open ()
Rst_SolComp_numRows = 0
if request("accion")<>"CA" then
if not Rst_SolComp.eof then
xFN_ID = Rst_SolComp("FN_ID")
else
xFN_ID = 0
end if
else
xFN_ID = request("xFN_ID")
end if


Rst_SolComp_numRows = 0
Rst_SolComp.Close()
Set Rst_SolComp = Nothing


Dim Rst_Fondos
Dim Rst_Fondos_numRows
Set Rst_Fondos = Server.CreateObject("ADODB.Recordset")
Rst_Fondos.ActiveConnection = MM_ChileCompras_STRING
Rst_Fondos.Source = "SELECT FN_ID, FN_TIPO FROM M_FONDOS ORDER BY FN_TIPO ASC"
strSQL = "SELECT FN_ID, FN_TIPO FROM M_FONDOS ORDER BY FN_TIPO ASC"
Rst_Fondos.CursorType = 0
Rst_Fondos.CursorLocation = 2
Rst_Fondos.LockType = 1
Rst_Fondos.Open ()
Rst_Fondos_numRows = 0
%>

<html>
<head>
<title>Manejo de combo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name=frm method=post>
<p>
<input type=hidden name=accion value="">
</p>

<% if xFN_ID = 1 then %> <!-- ESTA ES LA VARIABLE QUE ME INTERESA-->
<table width="100%" border="1">
<tr>
<td colspan="7"><div align="center"><strong>DATOS DEL PROVEEDOR</strong></div></td>
</tr>
</table>
<% end if%>

<select name=Combo_Fondos <%= lDisabled %> class=combo onChange="cambiaItem(this)">
<option value="">Seleccione Tipo Fondo</option>
<%
while not Rst_Fondos.eof
sele=""
if ""& xFN_ID = ""&Rst_Fondos("FN_ID") then sele="selected"
response.write("<option "&sele&" value='"&Rst_Fondos("FN_ID") &"' >"&Rst_Fondos("FN_TIPO")&"</option>")
Rst_Fondos.movenext
wend
Rst_Fondos.close%>
</select>
<input name="Sele" type="text" value="<%=xxsele%>" >
</body>
</html>


<script>
function cambiaItem(obj) {
document.frm.action="Combo.asp"
document.frm.accion.value=xFN_ID /*SE QUE ESTA MALO PERO NO SE COMO SE HACE */
document.frm.submit()
}
</script>