Server IP : 162.0.232.140 / Your IP : 3.147.71.176 Web Server : LiteSpeed System : Linux premium139.web-hosting.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : micrcvoy ( 740) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/micrcvoy/zomticksa.store/controlPanel/assets/plugins/parsleyjs/src/extra/validator/ |
Upload File : |
(function () { // minwords, maxwords, words extra validators var countWords = function (string) { return string .replace( /(^\s*)|(\s*$)/gi, "" ) .replace( /[ ]{2,}/gi, " " ) .replace( /\n /, "\n" ) .split(' ').length; }; window.ParsleyValidator.addValidator( 'minwords', function (value, nbWords) { return countWords(value) >= nbWords; }, 32) .addMessage('en', 'minwords', 'This value needs more words'); window.ParsleyValidator.addValidator( 'maxwords', function (value, nbWords) { return countWords(value) <= nbWords; }, 32) .addMessage('en', 'maxwords', 'This value needs fewer words'); window.ParsleyValidator.addValidator( 'words', function (value, arrayRange) { var length = countWords(value); return length >= arrayRange[0] && length <= arrayRange[1]; }, 32) .addMessage('en', 'words', 'This value has the incorrect number of words'); })();