You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,8 @@ Fires when counter is under min limit.
111
111
```javascript
112
112
type :"character", // "character" or "word"
113
113
min :0, // minimum number of characters/words
114
-
max :200, // maximum number of characters/words, -1 for unlimited, 'auto' to use maxlength attribute
114
+
max :200, // maximum number of characters/words, -1 for unlimited, 'auto' to use maxlength attribute, , 'autocustom' to use a custom attribute for the length (must set "autoCustomAttr")
115
+
autoCustomAttr :"counterlimit", // custom attribute name with the counter limit if the max is 'autocustom'
115
116
countContainerElement :"div", // HTML element to wrap the text count in
116
117
countContainerClass :"text-count-wrapper", // class applied to the countContainerElement
117
118
textCountMessageClass :"text-count-message", // class applied to the counter message
@@ -136,8 +137,8 @@ minDisplayCutoff : -1, // maximum number
136
137
maxDisplayCutoff :-1, // maximum number of characters/words below the maximum to display a count
137
138
138
139
// Callback API
139
-
maxunder:function(el){}, // Callback: function(element) - Fires when counter under max limit
140
-
minunder:function(el){}, // Callback: function(element) - Fires when counter under min limit
140
+
maxunder:function(el){}, // Callback: function(element) - Fires when counter is under max limit
141
+
minunder:function(el){}, // Callback: function(element) - Fires when counter is under min limit
141
142
maxcount:function(el){}, // Callback: function(element) - Fires when the counter hits the maximum word/character count
142
143
mincount:function(el){}, // Callback: function(element) - Fires when the counter hits the minimum word/character count
143
144
init:function(el){} // Callback: function(element) - Fires after the counter is initially setup
-[jmichalicek](https://github.com/jmichalicek) - count carriage returns/newlines as 2 characters
168
169
-[diptopol](https://github.com/diptopol) - `stopInputAtMaximum` with `twoCharCarriageReturn` count fix, trimmed newline calculation fix, maximum text reached condition fix, text count overflow notification
169
-
-[trevorloflin](https://github.com/trevorloflin) - `minDisplayCutoff` and `maxDisplayCutoff` options
170
+
-[trevorloflin](https://github.com/trevorloflin) - `minDisplayCutoff` and `maxDisplayCutoff` options
171
+
-[t3mujin](https://github.com/t3mujin) - autocustom support (maxlength workaround), text fixes
'max' : 200,// maximum number of characters/words, -1 for unlimited, 'auto' to use maxlength attribute
318
+
'max' : 200,// maximum number of characters/words, -1 for unlimited, 'auto' to use maxlength attribute, 'autocustom' to use a custom attribute for the length (must set "autoCustomAttr")
319
+
'autoCustomAttr' : "counterlimit",// custom attribute name with the counter limit if the max is 'autocustom'
309
320
'countContainerElement' : "div",// HTML element to wrap the text count in
310
321
'countContainerClass' : "text-count-wrapper",// class applied to the countContainerElement
311
322
'textCountMessageClass' : "text-count-message",// class applied to the counter message
0 commit comments