Tema: radio button
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/02/2002, 21:36
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 22 años, 4 meses
Puntos: 38
Re: radio button

Hay muchas maneras de hacerlo, prueba asi:

<html>
<head>
<script language="JavaScript">

function fnCero(){
alert("Cero");
}

function fnUno(){
alert("Uno");
}

function fnDos(){
alert("Dos");
}

function fnTres(){
alert("Tres");
}

function handleClick(){
if (document.prueba.st[0].checked) fnCero();
if (document.prueba.st[1].checked) fnUno();
if (document.prueba.st[2].checked) fnDos();
if (document.prueba.st[3].checked) fnTres();
}

</script>
</head>
<body>
<form name="prueba" onClick="handleClick()">
<input type="radio" value="A" name="st">Selection A<br>
<input type="radio" value="B" name="st">Selection B<br>
<input type="radio" value="C" name="st">Selection C<br>
<input type="radio" value="D" name="st">Selection D<br>
</form>
</body>
</html>