Home / Documentation / Version 2 / Guides / Adding Custom Form Fields / Available Validators
Available Validators
You are reading the documentation for Age Gate 2.x. Switch to the documentation for 3.x.
Below are all the available validation methods that can be used when creating custom form fields for Age Gate
requiredEnsures the specified key value exists and is not emptyvalid_emailChecks for a valid email addressmax_len,nChecks key value length, makes sure it’s not longer than the specified length. n = length parameter.min_len,nChecks key value length, makes sure it’s not shorter than the specified length. n = length parameter.exact_len,nEnsures that the key value length precisely matches the specified length. n = length parameter.alphaEnsure only alpha characters are present in the key value (a-z, A-Z)alpha_numericEnsure only alpha-numeric characters are present in the key value (a-z, A-Z, 0-9)alpha_dashEnsure only alpha-numeric characters + dashes and underscores are present in the key value (a-z, A-Z, 0-9, _-)alpha_spaceEnsure only alpha-numeric characters + spaces are present in the key value (a-z, A-Z, 0-9, \s)numericEnsure only numeric key valuesintegerEnsure only integer key valuesbooleanChecks for PHP accepted boolean values, returns TRUE for “1”, “true”, “on” and “yes”floatChecks for float valuesvalid_urlCheck for valid URL or subdomainurl_existsCheck to see if the url exists and is accessiblevalid_ipCheck for valid generic IP addressvalid_ipv4Check for valid IPv4 addressvalid_ipv6Check for valid IPv6 addressvalid_ccCheck for a valid credit card number (Uses the MOD10 Checksum Algorithm)valid_nameCheck for a valid format human namecontains,nVerify that a value is contained within the pre-defined value setcontains_list,nVerify that a value is contained within the pre-defined value set. The list of valid values must be provided in semicolon-separated list format (like so: value1;value2;value3;..;valuen). If a validation error occurs, the list of valid values is not revelead (this means, the error will just say the input is invalid, but it won’t reveal the valid set to the user.doesnt_contain_list,nVerify that a value is not contained within the pre-defined value set. Semicolon (;) separated, list not outputted. See the rule above for more info.street_addressChecks that the provided string is a likely street address. 1 number, 1 or more space, 1 or more lettersibanCheck for a valid IBANmin_numericDetermine if the provided numeric value is higher or equal to a specific valuemax_numericDetermine if the provided numeric value is lower or equal to a specific valuedateDetermine if the provided input is a valid date (ISO 8601)startsEnsures the value starts with a certain character / set of characterphone_numberValidate phone numbers that match the following examples: 555-555-5555 , 5555425555, 555 555 5555, 1(519) 555-4444, 1 (519) 555-4422, 1-555-555-5555regexYou can pass a custom regex using the following format: ‘regex,/your-regex/’valid_json_stringvalidate string to check if it’s a valid json format