Tengo este codigo ahora perno sigue sin funcionar.
Código Javascript
:
Ver originalmeta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<html>
<head>
<title>Formulario de Contacto en PHP por Dasumo</title>
<script type="text/javascript" src="validar.js"></script>
<script language="Javascript">
function bloquear(){
var form = document.formulario;
if(form.sexo[0].checked){
form.upa[0].disabled = true;
form.upa[1].disabled = true;
form.upa[2].disabled = false;
form.upa[3].disabled = false;
form.upa[4].disabled = false;
}else if(form.sexo[1].checked){
form.upa[0].disabled = false;
form.upa[1].disabled = false;
form.upa[2].disabled = true;
form.upa[3].disabled = true;
form.upa[4].disabled = false;
}
}
</script>
</head>
<body>
<!-- Inicio Formulario de Contacto por Dasumo-->
<div align="left">
<form method="post" action="contacto.php" onSubmit="return Validar(this);" name="formulario">
<label for="name">Nombre:
<input id="name" name="name" type="text" size="27"> </label><br><br>
<label for="apellido">Apellido:
<input id="apellido" name="apellido" type="text" size="27">
</label><br><br>
<label for="email">Correo Electrónico:
<input id="email" name="email" type="text" size="27"> </label>
<br><br>
<label for="sexo">Sexo:<br>
Masculino<input type="radio" name="sexo" value="M">
Femenino<input type="radio" name="sexo" value="F"></label>
<br><br>
<label for="edad">Edad:
<input id"edad" name="edad" type="text" size="1" maxlength="2"> </label>
<br><br>
<label for"upa">Usted pertenece a:<br>
A<input type="radio" name="upa" value="A" disabled><br>
B<input type="radio" name="upa" value="B" disabled><br>
C<input type="radio" name="upa" value="C" disabled><br>
D<input type="radio" name="upa" value="D" disabled><br>
E<input type="radio" name="upa" value="E" disabled><br><br>
</label>
<input type="submit" name="submit" value="Enviar" /><br>
</form>
</div>
<!-- Fin Formulario de contacto -->
</body>
<style = "text/css">
body{
font-family: Arial, Helvetica, sans-serif;
font-size:14px;
}
</style>
</html>
pero este que me dieron de ejemplo si funciona
Código Javascript
:
Ver original<html>
<head><title>Prueba</title>
<script language="Javascript">
function bloquear(){
var form = document.formulario;
if(form.sexo[0].checked){
form.estilo[0].disabled = true;
form.estilo[1].disabled = true;
form.estilo[2].disabled = false;
form.estilo[3].disabled = false;
}else if(form.sexo[1].checked){
form.estilo[0].disabled = false;
form.estilo[1].disabled = false;
form.estilo[2].disabled = true;
form.estilo[3].disabled = true;
}
}
</script>
</head>
<body>
<form method="POST" name="formulario">
<font color='red'>Elija su sexo:</font><br>
<input type="radio" name="sexo" onclick="bloquear();">Masculino</input>
<input type="radio" name="sexo" onclick="bloquear();">Femenino</input> <br>
<font color='red'>Cómo se le ve ?</font><br>
<input type="radio" name="estilo" value="Rubia" disabled>Rubia</input>
<input type="radio" name="estilo" value="Morocha" disabled>Morocha</input>
<input type="radio" name="estilo" value="Rubio" disabled>Rubio</input>
<input type="radio" name="estilo" value="Morocho" disabled>Morocho</input>
</form>
</body>
</html>
Alguna ayuda?