jquery - Handsontable Limit Cell Characters -
I am looking for an answer to a simple question, how to prevent a user from entering 250 characters in a cell, is? I've found that I can recreate a verification, but it can not prevent the user from entering more than 250 characters. I'm looking for something like the maximum length:
& lt; Input id = "notes" max length = "250" /> Var date_validator_regexp = / (^ $ | ^ (0 [1-9] | 1 [012]) [/] (0 [1-9] | [12] [0-9] | 3 [01]) [/] [0-9] {4} $) /; Var limit_validator_regexp = / (^ [\ s \ S] {0,250} $) /; $ ("# GridUpdateNotes") Handoutable (true), TrueWeb: true, minimum space: 1, callwidth: (startups: 1, startcols: 2, colHeaders: ["date", "notes"], column sorting: wrong, enter gigs [140, 450], Deleted plug-ins: true, copy paste: true, after verification: function (idle, value, line, prop, source) {if (isValid == incorrect & amp; amp; ;;; Amp;; amp; prop; === "Notes" ("Notes can not contain more than 250 characters.");}}, Columns: [[Data: "NoteDet", type: "Date" Date date : "Mm / day / traffic", permissions invalid: incorrect, verifier: date_validator_regexp}, {data: "notes", permissions invalid: incorrect, verifier: limit_validator_regexp}]});
This question is several months old, so Fusion does not need to answer anymore, but hopefully it will help someone.
Instead of using a regular expression as a legal practitioner, you can use a function.
Defined to work for me ...
cmlCols = [{Data: "Notes", Validation: Function (Value, Callback) {if (value.length & gt; 255) {Warning ('Must be 255 characters or less. Extra characters will be removed'); This.instance.setDataAtCell (this.row, this.col, value.substring (0, 255), blank); } Callback (true); }];
Comments
Post a Comment