|
1 | | -RestrictedTextField v1.2 |
| 1 | +RestrictedTextField v1.3 |
2 | 2 | ======================== |
3 | 3 |
|
4 | 4 | See LICENSE for this software's licensing terms. |
5 | 5 |
|
6 | | -RestrictedTextField is a jQuery plugin which uses regular expressions to validate and control input to HTML text fields. Using 35 built-in types or types you define yourself, it allows you to suppress invalid keystrokes or to allow them into the field for later validation. Fields are always validated on blur. |
| 6 | +RestrictedTextField is a jQuery plugin which uses regular expressions to validate and control input to HTML text fields. Using 38 built-in types or types you define yourself, it allows you to suppress invalid keystrokes or to allow them into the field but be flagged incorrect. Validation is performed on keystroke, paste and blur. |
7 | 7 |
|
8 | 8 |
|
9 | 9 | ## Features |
10 | 10 |
|
11 | 11 | * Discard invalid keystrokes or catch a validation failure event to handle it as you wish |
12 | | -* Has 35 built-in types |
| 12 | +* Has 38 built-in types |
13 | 13 | * Extensible: define your own types |
14 | 14 | * Money types automatically format on blur to end in a decimal point and two digits |
15 | 15 |
|
@@ -51,6 +51,9 @@ RestrictedTextField is a jQuery plugin which uses regular expressions to validat |
51 | 51 | 33. Discover |
52 | 52 | 34. Credit Card (combines all of the individual credit card types above) |
53 | 53 | 35. [Luhn-valid](https://en.wikipedia.org/wiki/Luhn_algorithm) numbers |
| 54 | +36. US zip code (5 digits) |
| 55 | +37. US zip code suffix (1-4 digits) |
| 56 | +38. US zip code (5 digits with optional suffix) |
54 | 57 |
|
55 | 58 |
|
56 | 59 | ## What's the difference between integer/strict integer, float/strict float? |
@@ -87,7 +90,7 @@ If you prefer not to use strictly-enforced credit card types (is Wikipedia corre |
87 | 90 |
|
88 | 91 | | Property | Description | Data Type | Valid Values | Default Value | |
89 | 92 | | -------- | --------------|---------- |----------------------|---------------| |
90 | | -| `type` | Text field type. This is a required setting. | string | alpha, upperAlpha, lowerAlpha, alphaSpace, upperAlphaSpace, lowerAlphaSpace, alphanumeric, upperAlphanumeric, lowerAlphanumeric, alphanumericSpace, upperAlphanumericSpace, lowerAlphanumericSpace, int, positiveInt, negativeInt, strictInt, strictPositiveInt, strictNegativeInt, float, positiveFloat, negativeFloat, strictFloat, strictPositiveFloat, strictNegativeFloat, money, positiveMoney, negativeMoney, accountingMoney, negativeAccountingMoney, americanExpress, visa, masterCard, discover, creditCard, luhnNumber | null | |
| 93 | +| `type` | Text field type. This is a required setting. | string | alpha, upperAlpha, lowerAlpha, alphaSpace, upperAlphaSpace, lowerAlphaSpace, alphanumeric, upperAlphanumeric, lowerAlphanumeric, alphanumericSpace, upperAlphanumericSpace, lowerAlphanumericSpace, int, positiveInt, negativeInt, strictInt, strictPositiveInt, strictNegativeInt, float, positiveFloat, negativeFloat, strictFloat, strictPositiveFloat, strictNegativeFloat, money, positiveMoney, negativeMoney, accountingMoney, negativeAccountingMoney, americanExpress, visa, masterCard, discover, creditCard, luhnNumber, usZip, usZip5, usZipSuffix | null | |
91 | 94 | | `preventInvalidInput` | When enabled, invalid keystrokes are ignored (the value of the text field is not updated). When disabled, invalid keystrokes are not ignored. | boolean | true/false | true | |
92 | 95 | | `logger` | An optional callback function for logging. If you want to enable logging, provide a function and then do whatever you wish with the message. | function | A function accepting the log message as a string argument | undefined | |
93 | 96 |
|
|
0 commit comments