Ver Mensaje Individual
  #7 (permalink)  
Antiguo 18/12/2010, 09:40
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Ayuda con un codigo muy basico

si he entendido, esto es lo que quieres
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>

<script languaje="javascript">
window.onload = function() {
for(var i = 0, padreCheck = document.getElementsByName('radiosA'); i < padreCheck.length; i++) {
padreCheck[i].onclick = function() {
alert('has seleccionado ' + this.nextSibling.nodeValue)
for(var n = 0, labels = document.getElementsByTagName('label'); n < labels.length; n++) {
if(labels[n].id == this.value) {
for(var j = 0, hijoCheck = document.getElementsByName(this.value); j < hijoCheck.length; j++) {
hijoCheck[j].style.visibility = 'visible';
}
} else {
for(var j = 0, hijoCheck = document.getElementsByName(labels[n].id); j < hijoCheck.length; j++) {
hijoCheck[j].style.visibility = 'hidden';
}
}
}
}
}
}
</script>


</head>

<body>


<form name="formulario">

<input type="radio" name="radiosA" value="rdA1">Opcion UNO<br>
<label for="rdA1" id="rdA1">
_ <input type="radio" name="rdA1" value="rdB1" style="visibility: hidden">Opcion 1 a habilitar<br>
_ <input type="radio" name="rdA1" value="rdB2" style="visibility: hidden">Opcion 2 a habilitar<br>
</label>
<br />

<input type="radio" name="radiosA" value="rdA2">Opcion DOS<br>
<label for="rdA2" id="rdA2">
_ <input type="radio" name="rdA2" value="rdB1" style="visibility: hidden">Opcion 1 a habilitar<br>
_ <input type="radio" name="rdA2" value="rdB2" style="visibility: hidden">Opcion 2 a habilitar<br>
</label>
<br />


<input type="radio" name="radiosA" value="rdA3">Opcion TRES<br>
<label for="rdA3" id="rdA3">
_ <input type="radio" name="rdA3" value="rdB1" style="visibility: hidden">Opcion 1 a habilitar<br>
_ <input type="radio" name="rdA3" value="rdB2" style="visibility: hidden">Opcion 2 a habilitar<br>
</label>
<br />

<input type="radio" name="radiosA" value="rdA4">Opcion CUATRO<br>
<label for="rdA4" id="rdA4">
_ <input type="radio" name="rdA4" value="rdB1" style="visibility: hidden">Opcion 1 a habilitar<br>
_ <input type="radio" name="rdA4" value="rdB2" style="visibility: hidden">Opcion 2 a habilitar<br>
</label>
<br />

</form>



</body>
</html>