Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/09/2007, 08:19
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 23 años
Puntos: 1284
Re: por que no se selecciona?

Hola:

Una chapuza, pero que funciona en explorer y que sin probarlo, afirmaría que también en los demás, es clonar un input con el name que quieras que no necesariamente tenga que pertenecer a un form (incluso oculto):

Código:
<html>
<head>
<script>
function radioSeleccionado(){ 

alert('clave es : ' + document.getElementById('valorRadio').value); 

} 

function creaRadios(){ 
    divCheck = document.getElementById('check'); 
    for(a=0;a<5;a++){ 
        var elemento=document.getElementById("unRadio").cloneNode(true); 
//        elemento.setAttribute("type", 'radio'); 
        elemento.value=a; 
        elemento.style.display = 'inline';
        //elemento.id="pruaba_"+a; 
//        elemento.NAME = "radios"; 
        elemento.onclick=function(){document.getElementById('valorRadio').value=this.value;};     
        //elemento.title=elemento.id; 
        divCheck.appendChild(elemento); 
        // if (a == 0) elemento.checked = true;
    } 
}  

</script>
</head>
<body>
<DIV style="width:146px; height : 125px;  z-index : 7000; 
             border:inset; border-width=2; background:#e6f2ff; 
     overflow=auto; position : absolute; top:115px ; left:400px; visibility:visible" id='check'> 
     </div> 
<input type="radio" id='unRadio' name="radios" style="display: none"/> 

<form action="">
<input type=hidden id='valorRadio'/> 


<input type=button value='crea Radios' onclick="creaRadios();"/> 
<input type=button value='Muestra Selección' onclick="radioSeleccionado();"/> 
</form>
</body>
</html>
Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo