I have added some custom javascript to a Ebase form to display a session time-out timer.
Since then the Ebase popup calendar (part of date field) won't work.
I think setting the innerHTML part is causing the problem. If I remove that part the pop calendar works fine again but it makes my custom script useless. I can't find any solution for it. Does anyone has a suggestion what the problem might be?
Code: Select all
/**
* Script: sessionTimer.js
* Date: 23-10-2007
* Author: Remco Visser
*/
// +++ Config +++ //
var sessionTimeOut = 30; //minuten
// +++ Globals +++ //
var seconden = 60;
var minuten = sessionTimeOut;
// +++ Functions +++ //
function init() {
sessionTimer();
}
function sessionTimer() {
if(minuten == sessionTimeOut)
minuten--;
if(seconden == 0) {
seconden = 60;
minuten--;
}
seconden--;
if(minuten == 0 && seconden == 0) {
var timer = "0:00";
document.getElementById("sessionTimer").innerHTML = timer;
} else {
if(seconden < 10) {
var timer = minuten + ":0" + seconden;
} else {
var timer = minuten + ":" + seconden;
}
document.getElementById("sessionTimer").innerHTML = timer;
setTimeout("sessionTimer()", 1000);
}
}