PageSourceSearch

https://mss.pendercountync.gov/ess/js/ClientCommon.js

js pendercountync.gov collected 2026-09-24 23:19:24 UTC 3,245 bytes, 53 lines download raw bytes

1//This fie contains common code for client-side DOM manipulation, validation, etc. 
2//Anything that needs to be done in the client without a Server request that may be used in multiple places can go here. 
3
4//All code should be placed inside the clientCommon object, this provides a namespace for all of these common methods.
5var clientCommon = {
6    validators: {
7        //The root level of validators has common validation that can be used in all areas of ESS
8        //All validators return true if the passed string is valid, false otherwise.
9
10        email: function(s) { return s ? s.length > 1 && s.match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/) : false; },
11        //Verifies that a string is a valid email address.  Supports all possible email address types.
12          
13        zipCode: function (s) {
14            if (s) {
15                return (s.length == 5 && !s.match(/[^0-9]/)) || (s.length == 10 && !s.match(/[^0-9-]/));
16            }
17            else {
18                return false;
19            }
20        },
21        //Verifies that a string is a valid zip code.  Can be 5 digit or 9 digit with dash e.g. 04215 or 04215-1419
22
23        applicants: {
24            //this contains validators that are specific to applicant areas in ESS
25
26            username: function (s) { return s ? s.length >= 1 && s.length < 63 && s.match(/[a-z]/i) && !s.match(/[^a-z0-9._\-@]/i) : false; },
27            //Applicant usernames must be 1-63 characters long (ApplicantPasswords.ApplicantUsername is a varchar(62)), have at least one letter, and only contain letters, numbers, and . or _ 
28
29            password: function (s) { return  s ? s.length >= 4 && !s.match(/\s/) : false; },
30            //validator for a single entry password
31
32            passwords: function (p, c) { return (p && c) ? p == c && p.length >= 4 && !p.match(/\s/) : false; },
33            //validator for two passwords (enter twice to confirm) 
34            //Applicant password entry just uses very simple validation on the client side.  
35            //ASP validators actually verify passwords against site-defined requirements when a request is sent to the server.
36            //this just checks that password length >= 4 and that two passwords match and there is no whitespace
37
38            name: function (s) { return s ? s.length >= 1 && !s.match(/[^a-z0-9'.,\-\s]/i) : false; },
39            //For names (first and last) - can only contain letters, numbers spaces, apostrophe, and [.,-] period or comma or hyphen.
40
41            pin: function (s) { return s ? s.length >= 1 && !s.match(/[^0-9]/) : false; },
42            //PIN numbers for migrating users to user/pass login- can only contain numbers
43            
44            securityAnswer: function (s) { return s ? s.length >= 1 && !s.match(/[^a-z0-9\s]/i) : false; },
45            //Answers to security questions for applicants- can only contain letters, numbers, and spaces.  No Symbols.
46
47            verifyEmailCode: function (s) { return s ? s.length == 8 && !s.match(/[^a-z0-9]/i) : false; }
48            //Email verification code is an 8-digit alphanumeric string 
49
50        } 
51
52    }
53};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.