Overview | File | Class | Tree | Index | Help
| Package /org/apache/commons/validator/javascript
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class GLOBALS

    Object
       |
       +--GLOBALS

class GLOBALS

Method Summary
`<static> Object` | `jcv_checkEmail(emailStr)` Reference: Sandeep V.
`<static> void` | `jcv_handleErrors(messages, focusField)` Handle error messages.
`<static> Object` | `jcv_isAllDigits(argvalue)` Check a value only contains valid numeric digits
`<static> Object` | `jcv_isDecimalDigits(argvalue)` Check a value only contains valid decimal digits
`<static> Object` | `jcv_isFieldPresent(field)` Checks whether the field is present on the form.
`<static> Object` | `jcv_isLuhnNum(argvalue)`
`<static> Object` | `jcv_isValidDate(day, month, year)`
`<static> Object` | `jcv_luhnCheck(cardNumber)` Checks whether a given credit card number has a valid Luhn checksum.
`<static> Object` | `jcv_matchPattern(value, mask)`
`<static> Object` | `jcv_retrieveFormName(form)` Retreive the name of the form
`<static> Object` | `jcv_verifyArrayElement(name, element)` Checks that the array element is a valid Commons Validator element and not one inserted by other JavaScript libraries (for example the prototype library inserts an "extends" into all objects, including Arrays).
`<static> Object` | `trim(s)`
`<static> Object` | `validateByte(form)` Check to see if fields are a valid byte.
`<static> Object` | `validateCreditCard(form)` Check to see if fields are a valid creditcard number based on Luhn checksum.
`<static> Object` | `validateDate(form)` Check to see if fields are a valid date.
`<static> Object` | `validateEmail(form)` Check to see if fields are a valid email address.
`<static> Object` | `validateFloat(form)` Check to see if fields are a valid float.
`<static> Object` | `validateFloatRange(form)` Check to see if fields are in a valid float range.
`<static> Object` | `validateInteger(form)` Check to see if fields are a valid integer.
`<static> Object` | `validateIntRange(form)` Check to see if fields is in a valid integer range.
`<static> Object` | `validateMask(form)` Check to see if fields are a valid using a regular expression.
`<static> Object` | `validateMaxLength(form)` A field is considered valid if less than the specified maximum.
`<static> Object` | `validateMinLength(form)` A field is considered valid if greater than the specified minimum.
`<static> Object` | `validateRequired(form)` Check to see if fields must contain a value.
`<static> Object` | `validateShort(form)` Check to see if fields are a valid short.

Method Detail

### jcv_checkEmail

    <static> Object jcv_checkEmail(emailStr)

Reference: Sandeep V. Tamhankar (stamhankar

### jcv_handleErrors

    <static> void jcv_handleErrors(messages, focusField)

Handle error messages.

Parameters:

`messages` - Array of error messages.

`focusField` - Field to set focus on.

### jcv_isAllDigits

    <static> Object jcv_isAllDigits(argvalue)

Check a value only contains valid numeric digits

Parameters:

`argvalue` - The value to check.

### jcv_isDecimalDigits

    <static> Object jcv_isDecimalDigits(argvalue)

Check a value only contains valid decimal digits

Parameters:

`argvalue` - The value to check.

### jcv_isFieldPresent

    <static> Object jcv_isFieldPresent(field)

Checks whether the field is present on the form.

Parameters:

`field` - The form field.

### jcv_isLuhnNum

    <static> Object jcv_isLuhnNum(argvalue)

### jcv_isValidDate

    <static> Object jcv_isValidDate(day, month, year)

### jcv_luhnCheck

    <static> Object jcv_luhnCheck(cardNumber)

Checks whether a given credit card number has a valid Luhn checksum. This allows you to spot most randomly made-up or garbled credit card numbers immediately. Reference: http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html

### jcv_matchPattern

    <static> Object jcv_matchPattern(value, mask)

### jcv_retrieveFormName

    <static> Object jcv_retrieveFormName(form)

Retreive the name of the form

Parameters:

`form` - The form validation is taking place on.

### jcv_verifyArrayElement

    <static> Object jcv_verifyArrayElement(name, element)

Checks that the array element is a valid Commons Validator element and not one inserted by other JavaScript libraries (for example the prototype library inserts an "extends" into all objects, including Arrays).

Parameters:

`name` - The element name.

`value` - The element value.

### trim

    <static> Object trim(s)

### validateByte

    <static> Object validateByte(form)

Check to see if fields are a valid byte. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateCreditCard

    <static> Object validateCreditCard(form)

Check to see if fields are a valid creditcard number based on Luhn checksum. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateDate

    <static> Object validateDate(form)

Check to see if fields are a valid date. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateEmail

    <static> Object validateEmail(form)

Check to see if fields are a valid email address. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateFloat

    <static> Object validateFloat(form)

Check to see if fields are a valid float. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateFloatRange

    <static> Object validateFloatRange(form)

Check to see if fields are in a valid float range. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateInteger

    <static> Object validateInteger(form)

Check to see if fields are a valid integer. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateIntRange

    <static> Object validateIntRange(form)

Check to see if fields is in a valid integer range. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateMask

    <static> Object validateMask(form)

Check to see if fields are a valid using a regular expression. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateMaxLength

    <static> Object validateMaxLength(form)

A field is considered valid if less than the specified maximum. Fields are not checked if they are disabled. Caution: Using validateMaxLength() on a password field in a login page gives unnecessary information away to hackers. While it only slightly weakens security, we suggest using it only when modifying a password.

Parameters:

`form` - The form validation is taking place on.

### validateMinLength

    <static> Object validateMinLength(form)

A field is considered valid if greater than the specified minimum. Fields are not checked if they are disabled. Caution: Using validateMinLength() on a password field in a login page gives unnecessary information away to hackers. While it only slightly weakens security, we suggest using it only when modifying a password.

Parameters:

`form` - The form validation is taking place on.

### validateRequired

    <static> Object validateRequired(form)

Check to see if fields must contain a value. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

### validateShort

    <static> Object validateShort(form)

Check to see if fields are a valid short. Fields are not checked if they are disabled.

Parameters:

`form` - The form validation is taking place on.

Overview | File | Class | Tree | Index | Help
| Package /org/apache/commons/validator/javascript
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ® 2000-2005 - Apache Software Foundation
Documentation generated by JSDoc on Tue Nov 28 22:30:05 2006