Hello i have this code to start chronometer and works fine:
<script type="text/javascript">
//setInterval
var cronometro;
function detenerse()
{
clearInterval(cronometro);
}
function carga()
{
contador_s =0;
contador_m =0;
s = document.getElementById("segundos");
m = document.getElementById("minutos");
cronometro = setInterval(
function(){
if(contador_s==60)
{
contador_s=0;
contador_m++;
m.innerHTML = contador_m;
if(contador_m==60)
{
contador_m=0;
}
}
s.innerHTML = contador_s;
contador_s++;
}
,1000);
}
</script>
<body onload="carga()">
<p>
<span id="minutos">0</span>:<span id="segundos">0</span>
</p>
<input type="button" onclick="detenerse()" value="Stop"/>
</body>
There is possible to call this function using method On_after_insert and on_after_update?
Thank you by your help!
Hi,
Your ticket somehow got delayed, apologies for that.
You cannot have JS code inside php callback functions.
You can have it using loadComplete event and it will run everytime grid reloads.
For usage ref: you can review demos/editing/custom-events.php
For element selection like:
s = document.getElementById("segundos");
m = document.getElementById("minutos");
You can inspect using firebug (f12) and replace element id.