Browse Source

add oncomplete to regex alias

Robin Herbots 11 years ago
parent
commit
d632256cf3
1 changed files with 24 additions and 0 deletions
  1. 24 0
      README.md

+ 24 - 0
README.md

@@ -558,6 +558,30 @@ Show the current mask definition as a tooltip.
   $(selector).inputmask({ mask: ["999-999-9999 [x99999]", "+099 99 99 9999[9]-9999"], showTooltip: true });
 ```
 
+## Function overrides
+### isComplete
+With this call-in you can override the default implementation of the isComplete function.  
+
+```javascript
+$("selector).inputmask("Regex", { 
+	regex: "[0-9]*", 
+	isComplete: function(buffer, opts) {
+		return new RegExp(opts.regex).test(buffer.join(''));
+	}
+});
+```
+
+### getMaskLength
+With this call-in you can override the default implementation of the getMaskLength function.  
+```javascript
+$("selector).inputmask({ 
+	alias: "decimal", 
+	getMaskLength: function(buffer, greedy, repeat, currentBuffer, opts) {
+		var calculatedLength = 10; //do some calculation		
+		return calculatedLength;
+	}
+});
+```
 
 ## Supported markup options
 ### RTL attribute