![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
30/05/2006, 15:13
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Os parece bien este sistema?
Código:
<html>
<head>
<script>
maximo=new Array();
maximo["hora"]=23;
maximo["minutos"]=55;
function cambiar(esto,a){
h=document.forms[0][esto]
h1=parseInt(h.value);
if(a<0){
h2=((h1+a)<0)?maximo[esto]:(h1+a);
}
else{
h2=((h1+a)>maximo[esto])?0:(h1+a);
}
h2=(h2<10)?"0"+h2:h2;
h.value=h2;
}
</script>
<title>Untitled</title>
<style>
input{
width:30px;
font:normal 11px/11px verdana;
}
input.texto{
border:solid 1px silver;
text-align:center;
}
</style>
</head>
<body>
<form>
<input type="button" value="^" class="boton" onclick="cambiar('hora',1)" /> <input type="button" value="^" class="boton" onclick="cambiar('minutos',5)" /><br />
<input type="texto" size="2" readonly="readonly" class="texto" name="hora" value="00" /> : <input value="00" class="texto" type="texto" size="2" readonly="readonly" name="minutos" /><br />
<input type="button" value="v" class="boton" onclick="cambiar('hora',-1)" /> <input type="button" value="v" class="boton" onclick="cambiar('minutos',-5)" />
</form>
</body>
</html>
Un saludo!
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |