Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/12/2013, 14:25
Avatar de rachpts
rachpts
 
Fecha de Ingreso: febrero-2012
Mensajes: 117
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Selección de radiobutton pasarla a input text

<html>
<head>

<script type="text/javascript">
function a(esto)
{


document.getElementById('resultado').value = esto;

}
</script>
</head>
<body>

<HR color="#006633">
<center>
<table width="300" border="1" bordercolor="#003366">


<tr><td width="104"><B>9:00-9:30 AM</B></td><td><?php if ($h1=="9:00 a 9:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="9:00 a 9:30 hrs" onclick="a(this)" >';}?></td></tr>
<tr><td width="104"><B>9:30-10:00 AM</B></td><td><?php if ($h2=="9:30 a 10:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="9:30 a 10:00 hrs" onclick="a(this)" >';}?></td></tr>
<tr><td width="94"><B>10:00-10:30 AM</B></td><td><?php if ($h3=="10:00 a 10:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="10:00 a 10:30 hrs" >';}?></td></tr>
<tr><td width="104"><B>10:30-11:00 AM</B></td><td><?php if ($h4=="10:30 a 11:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="10:30 a 11:00 hrs">';}?></td></tr>
<tr><td width="112"><B>11:00-11:30 AM</B></td><td><?php if ($h5=="11:00 a 11:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="11:00 a 11:30 hrs" >';}?></td></tr>
<tr><td width="113"><B>11:30-12:00 AM</B></td><td><?php if ($h6=="11:30 a 12:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="11:30 a 12:00 hrs" >';}?></td></tr>
<tr><td width="113"><B>12:00-12:30 AM</B></td><td><?php if ($h7=="12:00 a 12:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="12:00 a 12:30 hrs" >';}?></td></tr>
<tr><td width="119"><B>12:30-13:00 PM</B></td><td><?php if ($h8=="12:30 a 13:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="12:30 a 13:00 hrs" >';}?></td></tr>
<tr><td width="113"><B>13:00-13:30 PM</B></td><td><?php if ($h9=="13:00 a 13:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="13:00 a 13:30 hrs" >';}?></td></tr>
<tr><td width="140"><B>13:30-14:00 PM</B></td><td><?php if ($h10=="13:30 a 14:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="13:30 a 14:00 hrs">';}?></td></tr>
<tr><td width="140"><B>14:00-14:30 PM</B></td><td><?php if ($h11=="14:00 a 14:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="14:00 a 14:30 hrs">';}?></td></tr>
<tr><td width="140"><B>14:30-15:00 PM</B></td><td><?php if ($h12=="14:30 a 15:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="14:30 a 15:00 hrs" >';}?></td></tr>
<tr><td width="140"><B>16:00-16:30 PM</B></td><td><?php if ($h13=="16:00 a 16:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="16:00 a 16:30 hrs" >';}?></td></tr>
<tr><td width="140"><B>16:30-17:00 PM</B></td><td><?php if ($h14=="16:30 a 17:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="16:30 a 17:00 hrs" >';}?></td></tr>
<tr><td width="140"><B>17:00-17:30 PM</B></td><td><?php if ($h15=="17:00 a 17:30 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="17:00 a 17:30 hrs" >';}?></td></tr>
<tr><td width="140"><B>17:30-18:00 PM</B></td><td><?php if ($h16=="17:30 a 18:00 hrs"){ echo'<font color="#FF0000">Ocupado</font>';} else { echo'<input type="radio" name="horario" value="17:30 a 18:00 hrs">';}?></td></tr>

</table>




</center>

<form name="x" action="reserva_hrcita.php" method="post">
<input name="status" type="text" value="RESERVADO" /> <input name="area" type="text" />
<p>folio
<input name="folio" type="text" value="<?php
if(isset($_SESSION["folio"])){
$dato1 = $_SESSION["folio"];
echo "$dato1";
}
?>" />
fecha
<input name="fecha" type="text" value="<?php echo date("Y/m/d");?>" />
</p>

<p>Apellido Paterno
<input name="apaterno" type="text" />
Apellido Materno
<input name="amaterno" type="text" />
Nombre
<input name="nombre" type="text" />
</p>
<p>Teléfono
<input name="telefono" type="text" />
</p>
<p>E - mail
<input name="email" type="text" />
</p>
<p>Asunto


<input name="asunto" type="text" />
Hora
<input name="resultado" type="text" id="resultado" />............aqui quiero que aparezca lo que selecciono
Día
<input name="cita" value="" type="text" />
</p>

<p><input type="submit" name="guardar" value="Guardar Cita">

</form>

</body>
</html>