﻿function checkMaxLen(txt,maxLen) 
{ 
  try
 { 
     if(txt.value.length > (maxLen-1)) 
     { 
         var cont = txt.value; 
         txt.value = cont.substring(0,(maxLen -1)); 
     document.getElementById("count").innerHTML = 0;     
         return false; 
     }; 
  }
 catch(e)
 { 
  }
 document.getElementById("count").innerHTML = maxLen - txt.value.length ;
}; 