function checkDecimal(ID)
{
var strString = document.getElementById(ID).value;
var currIndex=strString.indexOf('.');
if(currIndex!=-1)
if(currIndex+4 <strString.length) // 4=n+1 number exmaple here is 3 code is for 3 decimal points so i used check for 4
{
alert("Only 3 decimal places are allowed to enter.");
document.getElementById(ID).focus();
return false;
}
}