Valor de un h:selectOneRadio desde javascript
Publicado por opalo (2 intervenciones) el 16/05/2007 16:17:48
No consigo acceder desde javascript al siguiente h:selectOneRadio
<h:selectOneRadio id="tipoUnidad" layout="pageDirection" style="font-family: Arial;font-weight:lighter;font-size: 12px" >
<f:selectItem itemValue="Verde" itemLabel="Unidad Verde:"/>
<f:selectItem itemValue="Azul" itemLabel="Unidad Azul:"/> </h:selectOneRadio>
Una vez que estamos en la función de javascript a la que llamo al clicar en algún radio button intento recuperar el valor con
var tipoUnidad = document.getElementById("formulario:tipoUnidad").value;
Pero nada, me dice que tipoUnidad es undefined.
¿Alguien me puede ayudar?
Gracias por anticipado
<h:selectOneRadio id="tipoUnidad" layout="pageDirection" style="font-family: Arial;font-weight:lighter;font-size: 12px" >
<f:selectItem itemValue="Verde" itemLabel="Unidad Verde:"/>
<f:selectItem itemValue="Azul" itemLabel="Unidad Azul:"/> </h:selectOneRadio>
Una vez que estamos en la función de javascript a la que llamo al clicar en algún radio button intento recuperar el valor con
var tipoUnidad = document.getElementById("formulario:tipoUnidad").value;
Pero nada, me dice que tipoUnidad es undefined.
¿Alguien me puede ayudar?
Gracias por anticipado
Valora esta pregunta


0