src/conbo/binding/AttributeBindings.js
function(el, value)
	{
		// TODO Restrict to text input fields?
		
		if (el.cbRestrict)
		{
			el.removeEventListener('keypress', el.cbRestrict);
		}
		
		el.cbRestrict = function(event)
		{
			if (event.ctrlKey)
			{
				return;
			}
			
			var code = event.keyCode || event.which;
			var char = event.key || String.fromCharCode(code);
			var regExp = value;
				
			if (!conbo.isRegExp(regExp))
			{
				regExp = new RegExp('['+regExp+']', 'g');
			}
			
			if (!char.match(regExp))
			{
				event.preventDefault();
			}
		};
		
		el.addEventListener('keypress', el.cbRestrict);
	}
function(el, value)
	{
		// TODO Restrict to text input fields?
		
		if (el.cbRestrict)
		{
			el.removeEventListener('keypress', el.cbRestrict);
		}
		
		el.cbRestrict = function(event)
		{
			if (event.ctrlKey)
			{
				return;
			}
			
			var code = event.keyCode || event.which;
			var char = event.key || String.fromCharCode(code);
			var regExp = value;
				
			if (!conbo.isRegExp(regExp))
			{
				regExp = new RegExp('['+regExp+']', 'g');
			}
			
			if (!char.match(regExp))
			{
				event.preventDefault();
			}
		};
		
		el.addEventListener('keypress', el.cbRestrict);
	}
function ( el , value ) { // TODO Restrict to text input fields?
 if ( el . cbRestrict ) { el . removeEventListener ( 'keypress' , el . cbRestrict ) ; } el . cbRestrict = function ( event ) { if ( event . ctrlKey ) { return ; } var code = event . keyCode || event . which ; var char = event . key || String . fromCharCode ( code ) ; var regExp = value ; if ( ! conbo . isRegExp ( regExp ) ) { regExp = new RegExp ( '[' + regExp + ']' , 'g' ) ; } if ( ! char . match ( regExp ) ) { event . preventDefault ( ) ; } } ; el . addEventListener ( 'keypress' , el . cbRestrict ) ; }
Restricts text input to the specified characters

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

@example
<div cb-restrict="propertyName"></div>
Restricts text input to the specified characters