Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2005, 15:04
Avatar de WILLIAMGG
WILLIAMGG
 
Fecha de Ingreso: febrero-2005
Mensajes: 218
Antigüedad: 20 años, 2 meses
Puntos: 0
Pregunta Radios y combos

Buenas a todos:
Tengo un problema: Resulta que tengo en mi formulario un radio y dos combos(pais y departamento), al seleccionar el primer combo, me borra lo seleccionado en el radio (claro que antes de ello ya seleccione el radio), coloco el codigo por si alguien tiene la molestia de analizarlo.
Gracias

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
function CaptaId(){
document.formulario.action="IngresoU.asp?CboDpto=" + document.formulario.CboPais.value;
[document.formulario.CboPais.selectedIndex].value;
document.formulario.submit();
}
function verifica(){
if (document.formulario.H.checked){
document.formulario.action ="IngresoU.asp?H="+ document.formulario.H.value; }
if (document.formulario.M.checked ){
document.formulario.action ="IngresoU.asp?M="+ document.formulario.M.value; }
document.formulario.submit();
}
</script>
</HEAD>
<BODY>
<%coneccion de la bd%>
<form name=formulario method=post >
<table>
<tr>
<td><strong>Sexo</strong></td>
<td><input type=radio name="H" VALUE="Hombre" ONCLICK="javascript:verifica();" <%if Request.QueryString("H")<>"" then%>checked<%end if%>> <strong>Hombre</strong>
<input type=radio name="M" VALUE="Mujer" ONCLICK="javascript:verifica();" <%if Request.QueryString("M")<>"" then%>checked<%end if%>> <strong>Mujer</strong></td>
</tr>
<tr><td><strong>Pais:</strong></td>
<%set tabla=coneccion.Execute("select * from PAIS")%>
<td><select name=CboPais onchange="javascript:CaptaId();">
<%idpais=cint(Request.QueryString("CboDpto"))%>
<%do while not tabla.eof %>
<option value="<%=tabla("IdP")%>" <%if idpais=cint(tabla("IdP")) then%>Selected <%End if%>>
<%=tabla("Nombre")%></option>
<%tabla.movenext
loop%>
</select></td>
</tr>
<%if Request.QueryString("CboDpto")<>"" then %>
<%ident=cint(Request.QueryString("CboDpto"))%>
<%set tablaD=coneccion.Execute("select * from DEPARTAMENTO where IdP="&ident&" ")%>
<tr><td><strong>Departamento:</strong></td>
<td><select name=CboDpto >
<%do while not tablaD.eof%>
<option value="<%=tablaD("IdD")%>"><%=tablaD("Nombre")%>
<%tablaD.movenext
loop%>
</select></td>
</tr>
<%tablaD.close
set tablaD=nothing%>
<%else%>
<tr><td><strong>Departamento:</strong></td><td><select name=CboDpto ></td></tr>
<%end if%>
<tr><td></td><td><input type=submit value="Enviar" name=envia></td></tr>
</table>
<%tabla.close
set tabla=nothing
coneccion.Close
set coneccion=nothing%>
</form>
</BODY>
</HTML>