﻿function checkTextAreaMaxLength(textBox, Name)
{
    var maxLength = textBox["Max_Length"];
    if(maxLength==null)
        return;
        
         if(textBox.value.length > maxLength)
         {
            textBox.value =  textBox.value.substring(0,maxLength);
            alert(Name + ' has ' + maxLength + ' characters limit. The information will be truncated.');
         }

}

function StripHTML(textBox)
{

    var mydiv = document.createElement("div");
    
    var str = textBox.value
    /*while (str.toLowerCase().indexOf("<br>") != -1)
        str.replace(/<br>/i, " ");*/
    
    mydiv.innerHTML = str;
 
    if (document.all) // IE Stuff
    {
        textBox.value = mydiv.innerText;
       
    }   
    else // Mozilla does not work with innerText
    {
        textBox.value = mydiv.textContent;
    }                            
}



