浏览代码

add oncomplete to regex alias

Robin Herbots 11 年之前
父节点
当前提交
d632256cf3
共有 1 个文件被更改,包括 24 次插入0 次删除
  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 });
   $(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
 ## Supported markup options
 ### RTL attribute
 ### RTL attribute