浏览代码

Wow. Apparently I suck at markdown;

Ross Hadden 14 年之前
父节点
当前提交
699a123ec5
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25 0
      README.md

+ 25 - 0
README.md

@@ -5,6 +5,7 @@ The plugin is based on the maskedinput plugin of Josh Bush (http://digitalbush.c
 A definition can have a cardinality and have multiple prevalidators.
 
 Example of some new definitions:
+
 ```javascript
      'm': { //month
         validator: function(chrs, buffer) {
@@ -42,6 +43,7 @@ Example of some new definitions:
 },
 insertMode: false
 ```
+
 These allow for a finer date validation then 99/99/9999 which also allows 33/33/3333 for example.  
 In the jquery.inputmask.extentions.js you find a full date input validation which takes days, months & leap years into account.
 
@@ -57,6 +59,7 @@ Include the js-files:
 <script src="jquery.inputmask.extentions.js" type="text/javascript"></script>
 
 Define your masks:
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("d/m/y");  //direct mask
@@ -68,6 +71,7 @@ $(document).ready(function(){
 ## Extra options:
 
 ### change the placeholder
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "placeholder": "*" });
@@ -75,6 +79,7 @@ $(document).ready(function(){
 ```
 
 or a multi-char placeholder
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "placeholder": "dd/mm/yyyy" });
@@ -82,6 +87,7 @@ $(document).ready(function(){
 ```
 
 ### execute a function when the mask is completed, incomplete or cleared
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "oncomplete": function(){ alert('inputmask complete'); } });
@@ -91,6 +97,7 @@ $(document).ready(function(){
 ```
 
 ### mask repeat function
+
 ```javascript
 $(document).ready(function(){
    $("#number").inputmask({ "mask": "9", "repeat": 10 });  // ~ mask "9999999999"
@@ -98,6 +105,7 @@ $(document).ready(function(){
 ```
 
 ### mask non-greedy repeat function
+
 ```javascript
 $(document).ready(function(){
    $("#number").inputmask({ "mask": "9", "repeat": 10, "greedy": false });  // ~ mask "9" or mask "99" or ... mask "9999999999"
@@ -105,6 +113,7 @@ $(document).ready(function(){
 ```
 
 ### get the unmaskedvalue
+
 ```javascript
 $(document).ready(function(){
    $("#number").inputmask('unmaskedvalue');
@@ -112,6 +121,7 @@ $(document).ready(function(){
 ```
 
 ### set a value and apply mask
+
 ```javascript
 $(document).ready(function(){
    $("#number").inputmask('setvalue', 12345); 
@@ -119,6 +129,7 @@ $(document).ready(function(){
 ```
 
 when the option patch_eval is set to true the same can be done with the traditionnal jquery.val function
+
 ```javascript
 $(document).ready(function(){
    $("#number").val(12345); 
@@ -126,6 +137,7 @@ $(document).ready(function(){
 ```
 
 with the autoUnmaskoption you can change the return of $.fn.val  to unmaskedvalue or the maskedvalue
+
 ```javascript
 $(document).ready(function(){
    	$('#<%= tbDate.ClientID%>').inputmask({ "mask": "d/m/y", 'autoUnmask' : true});	//  value: 23/03/1973
@@ -135,6 +147,7 @@ $(document).ready(function(){
 ```
 
 ### add custom definitions
+
 ```javascript
 $.extend($.inputmask.defaults.definitions, {
     'f': {
@@ -146,6 +159,7 @@ $.extend($.inputmask.defaults.definitions, {
 ```
 
 ### set defaults
+
 ```javascript
 $.extend($.inputmask.defaults, {
     'autounmask': true
@@ -153,6 +167,7 @@ $.extend($.inputmask.defaults, {
 ```
 
 ### numeric input direction
+
 ```javascript
 $(document).ready(function(){
     $('#test').inputmask('€ 999.999.999,99', { numericInput: true });    //   123456  =>  € ___.__1.234,56
@@ -160,6 +175,7 @@ $(document).ready(function(){
 ```
 
 ### remove the inputmask
+
 ```javascript
 $(document).ready(function(){
     $('#test').inputmask('remove');
@@ -167,6 +183,7 @@ $(document).ready(function(){
 ```
 
 ### escape special mask chars
+
 ```javascript
 $(document).ready(function(){
     $("#months").inputmask("m \\months");
@@ -174,6 +191,7 @@ $(document).ready(function(){
 ```
 
 ### clearIncomplete - remove incomplete input on blur
+
 ```javascript
 $(document).ready(function(){
     $("#ssn").inputmask("999-99-9999",{placeholder:" ", clearIncomplete: true });
@@ -184,6 +202,7 @@ $(document).ready(function(){
 When `clearIncomplete: true` is set in the options, the mask will treat masks marked option as separate from those that are not optional.
 
 For example, given:
+
 ```javascript
 $('#test').inputmask('999[-AAA]',{
 	clearIncomplete: true
@@ -194,6 +213,7 @@ When the required part of the mask is filled and the field loses focus, the user
 When both the required and optional parts of the mask are filled out and the field loses focus, the user will see `123-abc`.
 
 ### oncleared option
+
 ```javascript
 $(document).ready(function(){
     $("#ssn").inputmask("999-99-9999",{placeholder:" ", oncleared: function(){ alert('Set focus somewhere else ;-)');} });
@@ -203,6 +223,7 @@ $(document).ready(function(){
 ### aliases option
 
 First you have to create an alias definition (more examples can be found in jquery.inputmask.extentions.js)
+
 ```javascript
 $.extend($.inputmask.defaults.aliases, {
         'date': {
@@ -215,6 +236,7 @@ $.extend($.inputmask.defaults.aliases, {
 ```
 
 use:
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("date");       => equals to    $("#date").inputmask("d/m/y");
@@ -222,6 +244,7 @@ $(document).ready(function(){
 ```
 
 or use the dd/mm/yyyy alias of the date alias:
+
 ```javascript
 $(document).ready(function(){
    $("#date").inputmask("dd/mm/yyyy");       => equals to    $("#date").inputmask("d/m/y");
@@ -232,6 +255,7 @@ $(document).ready(function(){
 
 see jquery.inputmask.extentions.js for an example how to define "auto"-casing in a definition (definition A)
 casing can be null, "upper" or "lower"
+
 ```javascript
 $(document).ready(function(){
    $("#test").inputmask("999-AAA");       => 123abc ===> 123-ABC 
@@ -241,6 +265,7 @@ $(document).ready(function(){
 ### getemptymask command
 
 return the default (empty) mask value
+
 ```javascript
 $(document).ready(function(){
    $("#test").inputmask("999-AAA");