Originariamente inviato da fcrisafi
prenditi tutti i minuti che vuoi
ecco un esempio, dal quale puoi prendere spunto:
codice:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head><title>orario</title>
<script language="JavaScript">
function changeit(e, a, m){
var v=e.value;
if(a=="plus") if(v<m) v++;
if(a=="minus") if(v>0) v--;
if(v<10 && v!="00") v="0"+v;
if(v=="0") v="0"+v;
e.value=v;
}
</script>
</head>
<body>
<form name="f">
ore <input type="text" name="ore" value="00" size="2" maxlength="2" /> <input type="button" value="+" onclick="changeit(this.form.ore, 'plus', 24);" /> <input type="button" value="-" onclick="changeit(this.form.ore, 'minus', 24);" />
minuti <input type="text" name="minuti" value="00" size="2" maxlength="2" /> <input type="button" value="+" onclick="changeit(this.form.minuti, 'plus', 59);" /> <input type="button" value="-" onclick="changeit(this.form.minuti, 'minus', 60);" />
secondi <input type="text" name="secondi" value="00" size="2" maxlength="2" /> <input type="button" value="+" onclick="changeit(this.form.secondi, 'plus', 59);" /> <input type="button" value="-" onclick="changeit(this.form.secondi, 'minus', 60);" />
</form>
</body>
</html>
ciao