I got it,
function setColon()
{
var strTime = document.caseLog.time.value;
var strTimeL = strTime.length
if (strTimeL==4)
{
document.caseLog.time.value = strTime.substr(0,2) + ':' + strTime.substr(2,4)
}
if (strTimeL==3)
{
document.caseLog.time.value = strTime.substr(0,1) + ':' +...