/* Script for DataSprings Dynamic Forms
* http://dnn4.datasprings.com/Products/DNNModules/DynamicForms/DynamicFormsDemonstration6/tabid/842/Default.aspx
* This script allows to count the number of characters in a field
*
* Place this script in the Skin folder.
* It will be called by Design1_FixedFrench.ascx
*/
function countChars(dId,txtVal,limit)
  {
      var totalLen = txtVal.length + 1;
 
      if (totalLen < limit)
      {
          document.getElementById(dId).innerHTML = "<font color='red'>You have used " + totalLen + " of " + limit + " characters available.<br>You have " + (limit - totalLen) + " characters remaining.</font>"; 
      }
      else
      {
          document.getElementById(dId).innerHTML = "<font color='red'>You have exceeded the character limit for this field.</font>";
      }
  }