Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/09/2010, 14:30
Avatar de catpaw
catpaw
 
Fecha de Ingreso: mayo-2010
Ubicación: xalapa
Mensajes: 856
Antigüedad: 13 años, 11 meses
Puntos: 23
mostrar div dependiendo de radiobutton

Hola sigo aqui dando lata

tengo esta funcion entre el head con javascript:

Código:
<script language="JavaScript">
function habilita_div(){
if (document.fopcion.rad.value == "x_rpe"){
  document.getElementById('busqueda_rpe').style.display = "block"; 
}
</script>
y en mi codigo asi:

Código HTML:
<form name="fopcion">
Por:<br><br> 
<input type="radio" id="rad1" name="rad" value="x_rpe" onclick="habilita_div()"> RPE
<input type="radio" id="rad2" name="rad" value="x_numinv" onclick="habilita_div()"> N&uacute;m. Inventario
<input type="radio" id="rad3" name="rad" value="x_dos" onclick="habilita_div()"> Ambos
<br><br>
</form>
<div id="busqueda_rpe" style="display:none"> 
<form name="frpe" action="consulta_rpe.php" method="get" onSubmit="return valida_rpe(this.form)">
RPE: <input type="text" name="rpe" size="7" maxlength="5" onBlur="javascript:this.value=this.value.toUpperCase();" />
<input type='submit' value='Buscar' name='Buscar'>
</form>	
</div> 
y no me funciona
cuando le doy clic al radio de rpe, no me aparece el div id="busqueda_rpe"

que estoy haciendo mal???

gracias desde ya x su ayuda...