Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/10/2010, 21:53
hicetnunc86
 
Fecha de Ingreso: octubre-2010
Mensajes: 9
Antigüedad: 13 años, 6 meses
Puntos: 0
redireccionar presionando radiobutton

Hola tengo un codigo que valida radiobutton's y me saca un mensaje diferente dependiendo el radiobutton selecionado, pero al tomar esa validacion para que no saque mensajes sino que me redireccione a otro formulario no sirve esta validacion.
Este es el codigo ojala me puedan ayudar.


<script language="JavaScript" src="../js/jquery.js">
</script>

<script>
$(document).ready(function (){
$("#enviar").click( function() {
if($("#Cnatural").attr('checked')) {//aqui es donde quiero redireccionar
top.location.href='Formulario_Empresa.html';
}
if($("#Cempresa").attr("checked")) {//aqui el primer mensaje
alert("Claro");
}
if($("#Cfuncionarios").attr("checked")) {//aqui el segundo mensaje
alert("Como no");
}
});
});

</script>




<table width="282" border="0">
<tr>
<td height="51" colspan="3"><label></label>
<div align="center">Elija el tipo de Usuario a crear </div></td>
</tr>
<tr>
<td width="31" height="34">&nbsp;</td>
<td><label></label>
<label></label></td>
<td>


<form id="form12" method="post" action="" >
<label>
<input name="radiobutton" id ="Cnatural" type="radio" value="radio1" />
Cliente Natural</label>
<a href="Formulario_Usuario.html"></a>
<br>


<label>
<input name="radiobutton" id ="Cempresa" type="radio" value="radio2" />
Empresa</label>
<a href="Formulario_Empresas.html"></a>
<br>

<label>
<input name="radiobutton" id ="Cfuncionarios" type="radio" value="radio3" />
Funcionario</label>
</td>
</tr>
<tr>
<td height="34">&nbsp;</td>
<td width="6">&nbsp;</td>
<td width="197"><input type="submit" name="btn1" value="Aceptar" id="enviar">
<input type="submit" name="Submit2" value="Cancelar"/></td>
</tr>
</form>
</table>

Última edición por hicetnunc86; 01/11/2010 a las 13:57