# ValidationUtil Class

Defined in: `js/util/ValidationUtil.js:9`
Module: util
Parent Module: StructureJS

A ValidationUtility class that has several static methods to assist in development.

## Index

Show: Inherited Protected Private Deprecated

### Methods

- isEmpty static
- isMatch static
- isPostalCode static
- isSocialSecurityNumber static
- isValidEmailAddress static
- isValidPhoneNumber static
- isZipCode static

## Methods

### `isEmpty`
(

- `value`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:22`

Determines if the String passed has a length.

#### Parameters:

- `value` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isEmpty('sometext');
     // false

### `isMatch`
(

- `value1`
- `value2`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:40`

Determines if the two values passed in are the same.

#### Parameters:

- `value1` Any
- `value2` Any

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isMatch('one@email.com', 'two@email.com');
     // false

### `isPostalCode`
(

- `postalCode`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:104`

Determines if the String passed in is a postal code.

#### Parameters:

- `postalCode` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isPostalCode('p8n3h3');
     // true

### `isSocialSecurityNumber`
(

- `ssn`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:120`

Determines if the String passed in is a Social Security Number.

#### Parameters:

- `ssn` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isSocialSecurityNumber('178051120');
     // true

### `isValidEmailAddress`
(

- `email`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:56`

Determines if the String passed in is a valid email address.

#### Parameters:

- `email` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isValidEmailAddress('someemail@address.com');
     // true

### `isValidPhoneNumber`
(

- `phoneNumber`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:72`

Determines if the String passed in is a phone number.

#### Parameters:

- `phoneNumber` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isValidPhoneNumber('123 456 7899');
     // true

### `isZipCode`
(

- `zipCode`

)
Boolean public static

Defined in `js/util/ValidationUtil.js:88`

Determines if the String passed in is a zip code.

#### Parameters:

- `zipCode` String

#### Returns:

Boolean:

#### Example:

     ValidationUtil.isZipCode('55067 4434');
     // true

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index