Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/02/2006, 13:25
Avatar de ludovico2000
ludovico2000
 
Fecha de Ingreso: noviembre-2003
Ubicación: Bizkaia
Mensajes: 1.315
Antigüedad: 20 años, 6 meses
Puntos: 2
Ahora que tenía un ratito, he mejorado el asunto: ahora puedes habilitar/deshabilitar los input, para evitar usuarios patazas...

http://galeon.com/ludovico2000/test/index.htm

Resumen del código:

<script language="JavaScript">
var valor = 0;

function gestionarRadioButton(rb) {
valor = rb.value;
if (valor=="1") {
fecha1.disabled=false;
fecha1.style.background="white";
fecha2.disabled=true;
fecha2.style.background="#C3C3C3";
fecha3.disabled=true;
fecha3.style.background="#C3C3C3";
fecha4.disabled=true;
fecha4.style.background="#C3C3C3";

fecha1.focus();
uno.src="on.gif";
dos.src="off.gif";
tres.src="off.gif";
cuatro.src="off.gif";
}
else if (valor=="2") {
fecha1.disabled=true;
fecha1.style.background="#C3C3C3";
fecha2.disabled=false;
fecha2.style.background="white";

....

<input type=radio name="tipofecha" value="1" onclick="gestionarRadioButton(this)">Día concreto ... <br><input id="fecha1" type="text" size="17" style="background:#C3C3C3" disabled><a href="javascript:NewCal('fecha1','ddmmyyyy')"><img id="uno" src="off.gif" width="16" height="16" border="0" alt="Pulse para seleccionar una fecha"></a><br>