![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/resources/plugins/jquery-validation-1.16.0/src/additional/ |
( function() { function stripHtml( value ) { // Remove html tags and space chars return value.replace( /<.[^<>]*?>/g, " " ).replace( / | /gi, " " ) // Remove punctuation .replace( /[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "" ); } $.validator.addMethod( "maxWords", function( value, element, params ) { return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length <= params; }, $.validator.format( "Please enter {0} words or less." ) ); $.validator.addMethod( "minWords", function( value, element, params ) { return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length >= params; }, $.validator.format( "Please enter at least {0} words." ) ); $.validator.addMethod( "rangeWords", function( value, element, params ) { var valueStripped = stripHtml( value ), regex = /\b\w+\b/g; return this.optional( element ) || valueStripped.match( regex ).length >= params[ 0 ] && valueStripped.match( regex ).length <= params[ 1 ]; }, $.validator.format( "Please enter between {0} and {1} words." ) ); }() );