Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/05/2015, 10:50
Rissas
 
Fecha de Ingreso: mayo-2015
Mensajes: 5
Antigüedad: 9 años
Puntos: 0
Respuesta: Tiempo Limite en Php

Bueno empese haciendo un script estilo cronometro .. y cuando el tiempo llega a cero muestra el mensaje de que ya se tremino pero lo que quiero es que me cierre la encuesta .... el codigo es el siguiente:

<script language="javascript">
<!--
toHour=1;
toMinute=0;
toSecond=0;

function countDown()
{
toSecond=toSecond-1;
if(toSecond<0)
{
toSecond=5;
toMinute=toMinute-1;
}
form.second.value=toSecond;

if(toMinute<0)
{
toMinute=0;
toHour=toHour-1;
}
form.minute.value=toMinute;

form.hour.value=toHour;
if(toHour<0)
{
//final
form.second.value=0;
form.minute.value=0;
form.hour.value=0;

alert("se te acabo el tiempo");


}else{
setTimeout("countDown()",1000);
}
}
-->
</script>

<style type="text/css">
.form_input
{
font-family: Verdana;
font-size: 12;
color: #ffffff;
border-width: 0;
background-color: #000077;
text-align: right;
}
</style>
</head>

<body onload="countDown();">
<form name="form">
Tiempo restante...:
<input type="text" size="5" class="form_input" name="hour" disabled>:
<input type="text" size="5" class="form_input" name="minute" disabled>:
<input type="text" size="5" class="form_input" name="second" disabled>
</form>