src/conbo/binding/AttributeBindings.js
function(el, value)
	{
		// TODO Restrict to text input fields?
		
		if (el.cbMaxChars)
		{
			el.removeEventListener('keypress', el.cbMaxChars);
		}
		
		el.cbMaxChars = function(event)
		{
			if ((el.value || el.innerHTML).length >= value)
			{
				event.preventDefault();
			}
		};
		
		el.addEventListener('keypress', el.cbMaxChars);
	}
function(el, value)
	{
		// TODO Restrict to text input fields?
		
		if (el.cbMaxChars)
		{
			el.removeEventListener('keypress', el.cbMaxChars);
		}
		
		el.cbMaxChars = function(event)
		{
			if ((el.value || el.innerHTML).length >= value)
			{
				event.preventDefault();
			}
		};
		
		el.addEventListener('keypress', el.cbMaxChars);
	}
function ( el , value ) { // TODO Restrict to text input fields?
 if ( el . cbMaxChars ) { el . removeEventListener ( 'keypress' , el . cbMaxChars ) ; } el . cbMaxChars = function ( event ) { if ( ( el . value || el . innerHTML ) . length >= value ) { event . preventDefault ( ) ; } } ; el . addEventListener ( 'keypress' , el . cbMaxChars ) ; }
Limits the number of characters that can be entered into
input and other form fields

@param 		{HTMLElement}	el - DOM element to which the attribute applies
@param 		{string} 		value - The value referenced by the attribute
@returns		{void}

@example
<div cb-max-chars="propertyName"></div>
Limits the number of characters that can be entered into input and other form fields