﻿jQuery.fn.setMaxLength = function(limitedLength){
     jQuery(this).bind("click blur keyup", function() {   
            var text = jQuery(this).attr("value");
           
           // alert(jQuery(this).attr("value"));
            if(text !=null && text!='undefined'){
                var leftCharacter = limitedLength - text.length;
                //alert(leftCharacter);
                if(leftCharacter <= 0)
                {
                    text = text.substr(0, limitedLength);
                    jQuery(this).attr("value",text);
                }
            }
    });
};

