Browse Source

Wow. Apparently I suck at markdown;

Ross Hadden 14 years ago
parent
commit
699a123ec5
1 changed files with 25 additions and 0 deletions
  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.
 A definition can have a cardinality and have multiple prevalidators.
 
 
 Example of some new definitions:
 Example of some new definitions:
+
 ```javascript
 ```javascript
      'm': { //month
      'm': { //month
         validator: function(chrs, buffer) {
         validator: function(chrs, buffer) {
@@ -42,6 +43,7 @@ Example of some new definitions:
 },
 },
 insertMode: false
 insertMode: false
 ```
 ```
+
 These allow for a finer date validation then 99/99/9999 which also allows 33/33/3333 for example.  
 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.
 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>
 <script src="jquery.inputmask.extentions.js" type="text/javascript"></script>
 
 
 Define your masks:
 Define your masks:
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("d/m/y");  //direct mask
    $("#date").inputmask("d/m/y");  //direct mask
@@ -68,6 +71,7 @@ $(document).ready(function(){
 ## Extra options:
 ## Extra options:
 
 
 ### change the placeholder
 ### change the placeholder
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "placeholder": "*" });
    $("#date").inputmask("d/m/y",{ "placeholder": "*" });
@@ -75,6 +79,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 or a multi-char placeholder
 or a multi-char placeholder
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "placeholder": "dd/mm/yyyy" });
    $("#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
 ### execute a function when the mask is completed, incomplete or cleared
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("d/m/y",{ "oncomplete": function(){ alert('inputmask complete'); } });
    $("#date").inputmask("d/m/y",{ "oncomplete": function(){ alert('inputmask complete'); } });
@@ -91,6 +97,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### mask repeat function
 ### mask repeat function
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#number").inputmask({ "mask": "9", "repeat": 10 });  // ~ mask "9999999999"
    $("#number").inputmask({ "mask": "9", "repeat": 10 });  // ~ mask "9999999999"
@@ -98,6 +105,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### mask non-greedy repeat function
 ### mask non-greedy repeat function
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#number").inputmask({ "mask": "9", "repeat": 10, "greedy": false });  // ~ mask "9" or mask "99" or ... mask "9999999999"
    $("#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
 ### get the unmaskedvalue
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#number").inputmask('unmaskedvalue');
    $("#number").inputmask('unmaskedvalue');
@@ -112,6 +121,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### set a value and apply mask
 ### set a value and apply mask
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#number").inputmask('setvalue', 12345); 
    $("#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
 when the option patch_eval is set to true the same can be done with the traditionnal jquery.val function
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#number").val(12345); 
    $("#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
 with the autoUnmaskoption you can change the return of $.fn.val  to unmaskedvalue or the maskedvalue
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    	$('#<%= tbDate.ClientID%>').inputmask({ "mask": "d/m/y", 'autoUnmask' : true});	//  value: 23/03/1973
    	$('#<%= tbDate.ClientID%>').inputmask({ "mask": "d/m/y", 'autoUnmask' : true});	//  value: 23/03/1973
@@ -135,6 +147,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### add custom definitions
 ### add custom definitions
+
 ```javascript
 ```javascript
 $.extend($.inputmask.defaults.definitions, {
 $.extend($.inputmask.defaults.definitions, {
     'f': {
     'f': {
@@ -146,6 +159,7 @@ $.extend($.inputmask.defaults.definitions, {
 ```
 ```
 
 
 ### set defaults
 ### set defaults
+
 ```javascript
 ```javascript
 $.extend($.inputmask.defaults, {
 $.extend($.inputmask.defaults, {
     'autounmask': true
     'autounmask': true
@@ -153,6 +167,7 @@ $.extend($.inputmask.defaults, {
 ```
 ```
 
 
 ### numeric input direction
 ### numeric input direction
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
     $('#test').inputmask('€ 999.999.999,99', { numericInput: true });    //   123456  =>  € ___.__1.234,56
     $('#test').inputmask('€ 999.999.999,99', { numericInput: true });    //   123456  =>  € ___.__1.234,56
@@ -160,6 +175,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### remove the inputmask
 ### remove the inputmask
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
     $('#test').inputmask('remove');
     $('#test').inputmask('remove');
@@ -167,6 +183,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### escape special mask chars
 ### escape special mask chars
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
     $("#months").inputmask("m \\months");
     $("#months").inputmask("m \\months");
@@ -174,6 +191,7 @@ $(document).ready(function(){
 ```
 ```
 
 
 ### clearIncomplete - remove incomplete input on blur
 ### clearIncomplete - remove incomplete input on blur
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
     $("#ssn").inputmask("999-99-9999",{placeholder:" ", clearIncomplete: true });
     $("#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.
 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:
 For example, given:
+
 ```javascript
 ```javascript
 $('#test').inputmask('999[-AAA]',{
 $('#test').inputmask('999[-AAA]',{
 	clearIncomplete: true
 	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`.
 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
 ### oncleared option
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
     $("#ssn").inputmask("999-99-9999",{placeholder:" ", oncleared: function(){ alert('Set focus somewhere else ;-)');} });
     $("#ssn").inputmask("999-99-9999",{placeholder:" ", oncleared: function(){ alert('Set focus somewhere else ;-)');} });
@@ -203,6 +223,7 @@ $(document).ready(function(){
 ### aliases option
 ### aliases option
 
 
 First you have to create an alias definition (more examples can be found in jquery.inputmask.extentions.js)
 First you have to create an alias definition (more examples can be found in jquery.inputmask.extentions.js)
+
 ```javascript
 ```javascript
 $.extend($.inputmask.defaults.aliases, {
 $.extend($.inputmask.defaults.aliases, {
         'date': {
         'date': {
@@ -215,6 +236,7 @@ $.extend($.inputmask.defaults.aliases, {
 ```
 ```
 
 
 use:
 use:
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("date");       => equals to    $("#date").inputmask("d/m/y");
    $("#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:
 or use the dd/mm/yyyy alias of the date alias:
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#date").inputmask("dd/mm/yyyy");       => equals to    $("#date").inputmask("d/m/y");
    $("#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)
 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"
 casing can be null, "upper" or "lower"
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#test").inputmask("999-AAA");       => 123abc ===> 123-ABC 
    $("#test").inputmask("999-AAA");       => 123abc ===> 123-ABC 
@@ -241,6 +265,7 @@ $(document).ready(function(){
 ### getemptymask command
 ### getemptymask command
 
 
 return the default (empty) mask value
 return the default (empty) mask value
+
 ```javascript
 ```javascript
 $(document).ready(function(){
 $(document).ready(function(){
    $("#test").inputmask("999-AAA");    
    $("#test").inputmask("999-AAA");