2
Javascript below has mask hh:mm
. I need a mask in shape hh:mm:ss
.
Does anyone know any solution, or can help me adapt the code below?
function formatHora(campo, e)
{
if (!e)
return false;
car = (window.Event) ? e.which : e.keyCode;
if (car == 8)
return true;
if((((car >=48)&&(car <=57))||(car == 8)) && (campo.value.length < 7))
{
if (campo.value.length == 2)
campo.value = campo.value + ':';
// campo.value = campo.value + ':';
return true;
}
return false;
}
I appreciate the help.
Another way of doing: JS Mask for Hours Validation
– rray