Constructor

	Restrict(form: String)
	
		Generates an instance of Restrict.
		
			form name or id of the form that will receive the validations
		
	



	String.mask(mask: String): String
	
		Returns a string with the mask applied.
		
			mask mask that will be used
		
	



Properties

	Restrict.mask: Object
	
		This property is used to mask the fields and must be used as the following example:
		instanceOfRestrict.mask.nameOfTheFieldInTheForm = mask.
		Where mask follow the following rules:
		
			
				The class replaces each "#" character in the mask by the key that the user pressed.
				Ex: mask = "##/##/####" (to mask a date)
			
			
				As the "#" has a special meaning, if you need to use it as part of the mask,
				just comment it out with "\\". Ex: "\\#".
			
			
				The mask is applied from the left to the right, if the field has less characters
				than the mask, the "extra" characters of the mask will be ignored.
			
			
				If the field has more characters than the mask, the remaining characters of the
				field will be added to the end of the mask.
			
		
	
	Restrict.field: Object
	
		This property is used to filter the characters that can be inserted into the field.
		Must be used as the following example:
		instanceOfRestrict.field.nameOfTheFieldInTheForm = filter.
		Where filter follow the following rules:
		
			
				The filter is applied just to the character that was pressed out, and it's simple to use it, just type the
				characters that you want to allow.
				Ex: filter = "9aA." (will allow typing the characters "9", "a", "A", and ".")
			
			
				However, it would be bad to type all the alphabet characters in a field that must allow only letters,
				hence, there are pre-defined regular expressions in the class:
				
					"." = Any character
					"w": Only A-z, a-z, 0-9 and _
					"W": Any character, except: A-z, a-z, 0-9 and _
					"d": 0-9
					"D": Any character, except 0-9
					"s": Allows white space, tab, line break, etc. (\f\n\r\t\v)
					"a": Allows only letters with accent
					"A": Allows any character, except letters with accent
				
				If you need more rules, just define them on the source code.
				To use the regular expressions, just prefix the name of the rule with "\\".
				Ex: filter = "\\d\\s" (allows numbers and white spaces)
			
			
				It's also possible to specify exceptions for the filter by using the character "^".
				Ex: filter = "\\d^123" (allows 0-9, except the characters 1, 2 and 3)
			
			
				The bar "\\" and the "^" have a special meaning for the filter, if you need to use
				them as simple characters, just comment them with "\\" as in the example bellow:
				Ex: filter = "\\\\" (allows the bar)
				filter = "\\^" (allows the circumflex)
			
		


	


Methods

	Restrict.start(void): void
	Prepares the object. Must be called after all the rules are already setted.


Events

	Restrict.onKeyRefuse: function(field: HTMLInputElement, keyCode: Integer): void
	
		This event is called whenever the user press an invalid key.
		
			field field that is beeing edited
			keyCode key code
		
	

	Restrict.onKeyRefuse: function(field: HTMLInputElement, keyCode: Integer): void
	
		This event is called whenever the user press a valid key.
		
			field field that is beeing edited
			keyCode key code
		
	
