Ver Mensaje Individual
  #6 (permalink)  
Antiguo 04/11/2009, 04:43
Avatar de syntex
syntex
 
Fecha de Ingreso: noviembre-2002
Ubicación: Cataluña
Mensajes: 978
Antigüedad: 22 años, 2 meses
Puntos: 4
Respuesta: script dependiendo del radio

Ahora e modificado el script y me funciona pero con el problema que al darle al submit me coje el valor del radio 1 y e escojido el dos

Código PHP:
<form action="" method="get">
<?
    
if ($_GET[Radios] == 1){$X1="checked";} 
    if (
$_GET[Radios] == 2){$X2="checked";} 
    
?>
<input type="radio" id="r1" onclick="document.getElementById('div1').style.display = '';document.getElementById('div2').style.display='none';" name="Radios" value="1" <? echo $X1?> />
<input type="radio" id="r2" onclick="document.getElementById('div2').style.display = '';document.getElementById('div1').style.display='none';" name="Radios" value="2" <? echo $X2?> />
<input type="submit" name="" value="enviar">

<!-- CON EL RADIO PULSADO 1 -->
<div id="div1">
Nombre .: <input type="text" name="" value="">
Apellidos.: <input type="text" name="" value="">
<!-- -->
</div>
<!-- CON EL RADIO PULSADO 2 -->
<div id="div2" style="display:none">
Nombre empresa .: <input type="text" name="" value="">
Nombre contacto.: <input type="text" name="" value="">
</div>
<!-- -->


</form>
__________________
------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------