﻿function TextBoxMaxLength(TextBox, Length, Language)
{   var p_MaxLength = new Number(Length);
    if (TextBox.value.length > p_MaxLength) {
        TextBox.value = TextBox.value.substring(0, p_MaxLength);
        switch(Language)
        {   case 2:
                alert('Dit veld mag maximum ' + Length + ' karakters lang zijn.');
                break;    
            case 3:
                alert('This field should have a maximum length of ' + Length + ' characters.');
                break;
            default:
                alert('This field should have a maximum length of ' + Length + ' characters.');
        }
    }
}
