seahorse-1.2.js

Summary
seahorse-1.2.js
About Seahorse
IntroductionSeahorse is an open source JavaScript library created for simplify the use of forms, particularly the form validation.
LicenseThis library is licensed under the LGPL Version 3 license.
Validation behaviorsOne of the main features of this library are the functions to assign validation behaviors to the inputs.
Validation optionsThe validation options are parameters that restrict the values, or the format, that the data of an input can have to be considered valid.
Response optionsThe response options are parameters that determines the courses of actions when an user enter a valid or invalid input.
Functions
Validation behaviors
text()Gives to an element a text input behavior.
alphabetical()Gives to an element an alphabetical input behavior.
alphanumeric()Gives to an element an alphanumeric input behavior.
numeric()Gives to an element a numeric input behavior.
number()Gives to an element a float input behavior.
integer()Gives to an element an integer input behavior.
date()Gives to an element a date input behavior.
time()Gives to an element a time input behavior.
ipAddress()Gives to an element an IP address input behavior.
email()Gives to an element an e-mail address input behavior.
http()Gives to an element a HTTP address input behavior.
ftp()Gives to an element a FTP address input behavior.
form()Gives to an element a form behavior.
removeBehavior()Removes, from a element, any behavior asigned by a function of the Seahorse’s library.
Validation functions
isNumber()Checks if a string represents a number.
isInteger()Checks if a string represents an integer.
isNumeric()Checks if a string contains only numbers.
isAlphabetical()Checks if a string contains only alphabetical characters (including accents and another not Ascii characters).
isAlphanumeric()Checks if a string contains only alphanumeric characters.
isAlphabeticalAscii()Checks if a string contains only alphabetical ASCII characters.
isAlphanumericAscii()Checks if a string contains only alphanumeric ASCII characters.
isAsciiText()Checks if a string contains only ASCII characters.
isIPv4()Checks if a string represents an IP version 4 address.
isIPv6()Checks if a string represents an IP version 6 address.
isEmail()Checks if a string represents an e-mail address.
isHttp()Checks if a string represents a HTTP address.
isFtp()Checks if a string represents a FTP address.
isMonth()Checks if a string represents a month.
isDay()Checks if a string represents a day of a particular month.
isDate()Checks if string represents a date.
isTime()Checks if string represents an instant of time.
isDateFormat()Checks if string is a valid date format.
isTimeFormat()Checks if string is a valid time format.
validateForm()Checks if all the elements of a form have valid values.
passFilter()Acording to the value of ‘contains’, checks if all the characters of ‘cad’ are contained in ‘filter’ or if neither of the characters are contained.
Parsing functions
parseNumber()Parses a string and returns an number.
parseInteger()Parses a string and returns a integer.
parseIPv4()Parses a string that represents an IPv4 address and returns a array with four numbers.
parseIPv6()Parses a string that represents an IPv6 address and returns a array with eight hexadecimal numbers.
parseDate()Receives a string representing a date and transforms it according to the format passed as parameter.
parseTime()Receives a string representing an instant of time and transforms it according to the format passed as parameter.
filterString()Returns all the characters of ‘cad’ that are contained, or that aren’t contained, in ‘filter’.
Others
compareDate()Compare two strings that represents dates.
compareTime()Compare two strings that represents times.
serialize()Encode the elements of a form as a string.

About Seahorse

Introduction

Seahorse is an open source JavaScript library created for simplify the use of forms, particularly the form validation.

It provides functions to validate, parse and serialize data and to add real-time validation to inputs.

Seahorse can be used alone or it can be used with jQuery, using the plugin designed for that purpose.

License

This library is licensed under the LGPL Version 3 license.

That means you can use Seahorse to develop commercial or open source projects, but, in both cases, you must publish, under a licence compatible with LGPL v3, any changes you make to the library.

Validation behaviors

One of the main features of this library are the functions to assign validation behaviors to the inputs.

An input with a validation behavior can avoid the input of invalid characters or perform diferent actions (like add a CSS class to a element or invoke a JavaScript function) when a user inserts valid or invalid data.

The validation behaviors functions receives as parameter the id of the element to be validated, a JSON element with the validation options and a JSON element with the response options.

Validation options

The validation options are parameters that restrict the values, or the format, that the data of an input can have to be considered valid.

The variables that can be defined in the JSON element of validation options are

notEmptyA boolean indicating if the field can be left in blank.
minLengthThe minimum length of a text input (by default, 0).
maxLengthThe maximun length of a text input (by default, infinity).
minValueThe minimum value of a input (by default, minus infinity for numbers and null for dates and times).
maxValueThe maximun value of a input (by default, infinity for numbers and null for dates and times).
formatThe format of a input (by default ‘yyyy-mm-dd’ for dates and ‘hh:mm:ss’ for times).
autofillA boolean indicating if the incomplete fields of dates or times must be completed with the actual date or time.
versionThe version of an IP address input (by default, 4).
requiredCharactersA string or a array of unicode values representing the group of characters that a text input must have to be considered valid.
forbiddenCharactersA string or a array of unicode values representing the group of characters that a text input must not have to be considered valid.
allowedCharactersA string or a array of unicode values representing the group of characters that a text input can have and be considered valid, no matter the restrictions of his type.
asciiCharactersA boolean indicating if a text input must have only ASCII characters (by default ‘false’).
decimalCharacterThe character used as decimal character in a numeric input (by default ‘.’).
groupingCharacterThe character used as grouping character in a numeric input (by default ‘,’).
aditionalValidationA user’s defined function that test if a field has a valid value.  This function is called only if the field has been validated by the standard Seahorse’s validation function.

This variables are optionals and they are not used by all the functions, each function uses only a few variables, for example, for restrict the lenght, text() uses minLength and maxLength while number() uses minValue and maxValue.

Response options

The response options are parameters that determines the courses of actions when an user enter a valid or invalid input.

The variables that can be defined in the JSON element of response options are

errorClassThe class added to the input if the data entered is invalid.
okClassThe class added to the input if the data entered is valid.
targetErrorClassThe class added to a given element if the data entered is invalid.
targetOkClassThe class added to a given element if the data entered is valid.
targetIdThe id of the element to which add the classes ‘targetErrorClass’ or ‘targetOkClass’.
hiddenElementIdThe id of the element to hide or show, depending if the data entered is valid or invalid.
callbackFunctionA function to invoke after that the input was validated.  The function must receive two parameters: ‘element’ (the object that represents the input) and ‘valid’ (a boolean indicating if the data entered is valid or not).
forbidEntranceA boolean indicating if the entrance of invalid characters must be forbidden (by default, ‘true’).
autoparseA boolean indicating if the data in the fields must be parsed in order to eliminate unnecessary characters.
errorMessageA message explaining why the value of the input is invalid.

This variables are optionals and can be specified for all the validation functions.

Functions

Summary
Validation behaviors
text()Gives to an element a text input behavior.
alphabetical()Gives to an element an alphabetical input behavior.
alphanumeric()Gives to an element an alphanumeric input behavior.
numeric()Gives to an element a numeric input behavior.
number()Gives to an element a float input behavior.
integer()Gives to an element an integer input behavior.
date()Gives to an element a date input behavior.
time()Gives to an element a time input behavior.
ipAddress()Gives to an element an IP address input behavior.
email()Gives to an element an e-mail address input behavior.
http()Gives to an element a HTTP address input behavior.
ftp()Gives to an element a FTP address input behavior.
form()Gives to an element a form behavior.
removeBehavior()Removes, from a element, any behavior asigned by a function of the Seahorse’s library.
Validation functions
isNumber()Checks if a string represents a number.
isInteger()Checks if a string represents an integer.
isNumeric()Checks if a string contains only numbers.
isAlphabetical()Checks if a string contains only alphabetical characters (including accents and another not Ascii characters).
isAlphanumeric()Checks if a string contains only alphanumeric characters.
isAlphabeticalAscii()Checks if a string contains only alphabetical ASCII characters.
isAlphanumericAscii()Checks if a string contains only alphanumeric ASCII characters.
isAsciiText()Checks if a string contains only ASCII characters.
isIPv4()Checks if a string represents an IP version 4 address.
isIPv6()Checks if a string represents an IP version 6 address.
isEmail()Checks if a string represents an e-mail address.
isHttp()Checks if a string represents a HTTP address.
isFtp()Checks if a string represents a FTP address.
isMonth()Checks if a string represents a month.
isDay()Checks if a string represents a day of a particular month.
isDate()Checks if string represents a date.
isTime()Checks if string represents an instant of time.
isDateFormat()Checks if string is a valid date format.
isTimeFormat()Checks if string is a valid time format.
validateForm()Checks if all the elements of a form have valid values.
passFilter()Acording to the value of ‘contains’, checks if all the characters of ‘cad’ are contained in ‘filter’ or if neither of the characters are contained.
Parsing functions
parseNumber()Parses a string and returns an number.
parseInteger()Parses a string and returns a integer.
parseIPv4()Parses a string that represents an IPv4 address and returns a array with four numbers.
parseIPv6()Parses a string that represents an IPv6 address and returns a array with eight hexadecimal numbers.
parseDate()Receives a string representing a date and transforms it according to the format passed as parameter.
parseTime()Receives a string representing an instant of time and transforms it according to the format passed as parameter.
filterString()Returns all the characters of ‘cad’ that are contained, or that aren’t contained, in ‘filter’.
Others
compareDate()Compare two strings that represents dates.
compareTime()Compare two strings that represents times.
serialize()Encode the elements of a form as a string.

Validation behaviors

text()

text : function(element,
validationOptions,
responseOptions)

Gives to an element a text input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minLength, maxLength, asciiCharacters, allowedCharacters, requiredCharacters and forbiddenCharacters).
responseOptionsA JSON element with the response options.

alphabetical()

alphabetical : function(element,
validationOptions,
responseOptions)

Gives to an element an alphabetical input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minLength, maxLength, asciiCharacters, allowedCharacters, requiredCharacters and forbiddenCharacters).
responseOptionsA JSON element with the response options.

alphanumeric()

alphanumeric : function(element,
validationOptions,
responseOptions)

Gives to an element an alphanumeric input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minLength, maxLength, asciiCharacters, allowedCharacters, requiredCharacters and forbiddenCharacters).
responseOptionsA JSON element with the response options.

numeric()

numeric : function(element,
validationOptions,
responseOptions)

Gives to an element a numeric input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minLength, maxLength, asciiCharacters, allowedCharacters, requiredCharacters and forbiddenCharacters).
responseOptionsA JSON element with the response options.

number()

number : function(element,
validationOptions,
responseOptions)

Gives to an element a float input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minValue, maxValue, groupingCharacter and decimalCharacter).
responseOptionsA JSON element with the response options.

integer()

integer : function(element,
validationOptions,
responseOptions)

Gives to an element an integer input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minValue, maxValue and groupingCharacter).
responseOptionsA JSON element with the response options.

date()

date : function(element,
validationOptions,
responseOptions)

Gives to an element a date input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minValue, maxValue, autofill and format).
responseOptionsA JSON element with the response options.

time()

time : function(element,
validationOptions,
responseOptions)

Gives to an element a time input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation, minValue, maxValue, autofill and format).
responseOptionsA JSON element with the response options.

ipAddress()

ipAddress : function(element,
validationOptions,
responseOptions)

Gives to an element an IP address input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty, aditionalValidation and version).
responseOptionsA JSON element with the response options.

email()

email : function(element,
validationOptions,
responseOptions)

Gives to an element an e-mail address input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty and aditionalValidation).
responseOptionsA JSON element with the response options.

http()

http : function(element,
validationOptions,
responseOptions)

Gives to an element a HTTP address input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty and aditionalValidation).
responseOptionsA JSON element with the response options.

ftp()

ftp : function(element,
validationOptions,
responseOptions)

Gives to an element a FTP address input behavior.

Parameters

elementThe element id or the element object.
validationOptionsA JSON element with the validation options (notEmpty and aditionalValidation).
responseOptionsA JSON element with the response options.

form()

form : function(form,
responseFunction,
errorMessage)

Gives to an element a form behavior.

That means that it modifies the submit method of the form in order to validate all the inputs before submit.

The ‘responseFunction’ parameter is the function called when the form is submited but one or more inputs, of the form, has invalid values.  This function must receive two parameters: a string with the error messages of the form and the inputs and an array with all the input elements that have invalid values.

Parameters

formThe form id or the form object.
responseFunctionThe function called if one of more inputs of the form are invalid.
errorMessageThe message to be displayed if one of more inputs of the form are invalid.

removeBehavior()

removeBehavior : function(element)

Removes, from a element, any behavior asigned by a function of the Seahorse’s library.

Parameters

elementThe element id or the element object.

Validation functions

isNumber()

isNumber : function(cad,
ds,
gs)

Checks if a string represents a number.

Parameters

cadA string.
dsThe character used as digital separator.
gsThe character used as grouping separator.

Returns

true if the string represents a number and false in the opposite case.

isInteger()

isInteger : function(cad,
gs)

Checks if a string represents an integer.

Parameters

cadA string.
gsThe character used as grouping separator.

Returns

true if the string represents an integer and false in the opposite case.

isNumeric()

isNumeric : function(cad)

Checks if a string contains only numbers.

Parameters

cadA string.

Returns

true if the string contains only numbers and false in the opposite case.

isAlphabetical()

isAlphabetical : function(cad)

Checks if a string contains only alphabetical characters (including accents and another not Ascii characters).

Parameters

cadA string.

Returns

true if the string contains only alphabetical characters and false in the opposite case.

isAlphanumeric()

isAlphanumeric : function(cad)

Checks if a string contains only alphanumeric characters.

Parameters

cadA string.

Returns

true if the string contains only alphanumeric characters and false in the opposite case.

isAlphabeticalAscii()

isAlphabeticalAscii : function(cad)

Checks if a string contains only alphabetical ASCII characters.

Parameters

cadA string.

Returns

true if the string contains only alphabetical ASCII characters and false in the opposite case.

isAlphanumericAscii()

isAlphanumericAscii : function(cad)

Checks if a string contains only alphanumeric ASCII characters.

Parameters

cadA string.

Returns

true if the string contains only alphanumeric ASCII characters and false in the opposite case.

isAsciiText()

isAsciiText : function(cad)

Checks if a string contains only ASCII characters.

Parameters

cadA string.

Returns

true if the string contains only ASCII characters and false in the opposite case.

isIPv4()

isIPv4 : function(ip)

Checks if a string represents an IP version 4 address.

Parameters

ipA string.

Returns

true if the string represents an IP version 4 address and false in the opposite case.

isIPv6()

isIPv6 : function(ip)

Checks if a string represents an IP version 6 address.

Parameters

ipA string.

Returns

true if the string represents an IP version 6 address and false in the opposite case.

isEmail()

isEmail : function(mail)

Checks if a string represents an e-mail address.

Parameters

mailA string.

Returns

true if the string represents an e-mail address and false in the opposite case.

isHttp()

isHttp : function(http)

Checks if a string represents a HTTP address.

Parameters

httpA string.

Returns

true if the string represents a HTTP address and false in the opposite case.

isFtp()

isFtp : function(ftp)

Checks if a string represents a FTP address.

Parameters

ftpA string.

Returns

true if the string represents a FTP address and false in the opposite case.

isMonth()

isMonth : function(mes)

Checks if a string represents a month.  This function considers that a month is a number that must be between 1 and 12 (while the class Date considers a month like a number between 0 and 11).

Parameters

mesA string.

Returns

true if the string represents a month and false in the opposite case.

isDay()

isDay : function(dia,
mes,
anio)

Checks if a string represents a day of a particular month.  This function considers that a month is a number that must be between 1 and 12 (while the class Date considers a month like a number between 0 and 11).

Parameters

diaA string that represents a day.
mesA string that represents a month.
anioA string that represents a year.

Returns

true if ‘dia’ represents a day of the month ‘mes’ and false in the opposite case or if ‘mes’ it’s not a month.

isDate()

isDate : function(cad,
format,
fill)

Checks if string represents a date.

Parameters

cadA string that represents a date.
formatA string that represents a date format.
fillA boolean that indicates if the empty fields have to be completed with the actual date.

Returns

true if the string represents a date and false in the oposite case.

isTime()

isTime : function(cad,
format,
fill)

Checks if string represents an instant of time.

Parameters

cadA string that represents an instant of time.
formatA string that represents a time format.
fillA boolean that indicates if the empty fields have to be completed with the actual time.

Returns

true if the string represents an instant of time and false in the oposite case.

isDateFormat()

isDateFormat : function(format)

Checks if string is a valid date format.

Parameters

cadA string that represents a date format.

Returns

true if the string is a valid date format and false in the oposite case.

isTimeFormat()

isTimeFormat : function(format)

Checks if string is a valid time format.

Parameters

cadA string that represents a time format.

Returns

true if the string is a valid time format and false in the oposite case.

validateForm()

validateForm : function(idForm)

Checks if all the elements of a form have valid values.

Parameters

idFormThe id of the form to be validated.

Returns

true if all the elements of the form have valid values.  false if one or more elements of the form have invalid values.

passFilter()

passFilter : function(cad,
filter,
contains)

Acording to the value of ‘contains’, checks if all the characters of ‘cad’ are contained in ‘filter’ or if neither of the characters are contained.

Parameters

cadA string to filter.
filterA string used as filter.
containsA boolean indicating the mode of operation.

Returns

true if all the characters of ‘cad’ are contained in ‘filter’ and false in the oposite case.  true if neither of the characters of ‘cad’ are contained in ‘filter’ and false in the oposite case.

Parsing functions

parseNumber()

parseNumber : function(cad,
ds,
gs)

Parses a string and returns an number.

Parameters

cadA string.
dsThe character used as digital separator.
gsThe character used as grouping separator.

Returns

A number if the string is a number or NaN in the oposite case.

parseInteger()

parseInteger : function(cad,
gs)

Parses a string and returns a integer.

Parameters

cadA string.
gsThe character used as grouping separator.

Returns

An integer if the string is a number or NaN in the oposite case.

parseIPv4()

parseIPv4 : function(ip)

Parses a string that represents an IPv4 address and returns a array with four numbers.

Parameters

ipA string.

Returns

An array of four numbers if the string represents an IPv4 address or null in the oposite case.

parseIPv6()

parseIPv6 : function(ip)

Parses a string that represents an IPv6 address and returns a array with eight hexadecimal numbers.

Parameters

ipA string.

Returns

An array of eight hexadecimal numbers if the string represents an IPv6 address or null in the oposite case.

parseDate()

parseDate : function(cad,
format,
fill)

Receives a string representing a date and transforms it according to the format passed as parameter.

Parameters

cadA string that represents a date.
formatA string that represents a valid date format.
fillA boolean that indicates if the empty fields have to be completed with the actual date.

Returns

A formated string that represents a date if ‘cad’ represents a date and ‘format’ is a valid date format or null in the oposite case.

parseTime()

parseTime : function(cad,
format,
fill)

Receives a string representing an instant of time and transforms it according to the format passed as parameter.

Parameters

cadA string that represents an instant of time.
formatA string that represents a valid time format.
fillA boolean that indicates if the empty fields have to be completed with the actual time.

Returns

A formated string that represents an instant of time if ‘cad’ represents an instant of time and ‘format’ is a valid time format or null in the oposite case.

filterString()

filterString : function(cad,
filter,
contains)

Returns all the characters of ‘cad’ that are contained, or that aren’t contained, in ‘filter’.

Parameters

cadA string to filter.
filterA string used as filter.
containsA boolean indicating the mode of operation.

Returns

All the characters of ‘cad’ that are contained in ‘filter’, if ‘contains’ is equal to true.  All the characters of ‘cad’ that aren’t contained in ‘filter’, if ‘contains’ is equal to false.

Others

compareDate()

compareDate : function(date1,
date2,
dateFormat)

Compare two strings that represents dates.

Parameters

date1The first date.
date2The second date.
dateFormatThe date format of the two dates.

Returns

A negative number if date1 < date2, a positive number if date1 > date2, zero if date1 = date2 or null in case of error.

compareTime()

compareTime : function(time1,
time2,
timeFormat)

Compare two strings that represents times.

Parameters

time1The first time.
time2The second time.
timeFormatThe date format of the two times.

Returns

A negative number if time1 < time2, a positive number if time1 > time2, zero if time1 = time2 or null in case of error.

serialize()

serialize : function(form,
notation)

Encode the elements of a form as a string.

Parameters

formThe form id or the form object.
codificationThe notation to be used (JSON or URL)

Returns

The form serialized.

text : function(element,
validationOptions,
responseOptions)
Gives to an element a text input behavior.
alphabetical : function(element,
validationOptions,
responseOptions)
Gives to an element an alphabetical input behavior.
alphanumeric : function(element,
validationOptions,
responseOptions)
Gives to an element an alphanumeric input behavior.
numeric : function(element,
validationOptions,
responseOptions)
Gives to an element a numeric input behavior.
number : function(element,
validationOptions,
responseOptions)
Gives to an element a float input behavior.
integer : function(element,
validationOptions,
responseOptions)
Gives to an element an integer input behavior.
date : function(element,
validationOptions,
responseOptions)
Gives to an element a date input behavior.
time : function(element,
validationOptions,
responseOptions)
Gives to an element a time input behavior.
ipAddress : function(element,
validationOptions,
responseOptions)
Gives to an element an IP address input behavior.
email : function(element,
validationOptions,
responseOptions)
Gives to an element an e-mail address input behavior.
http : function(element,
validationOptions,
responseOptions)
Gives to an element a HTTP address input behavior.
ftp : function(element,
validationOptions,
responseOptions)
Gives to an element a FTP address input behavior.
form : function(form,
responseFunction,
errorMessage)
Gives to an element a form behavior.
removeBehavior : function(element)
Removes, from a element, any behavior asigned by a function of the Seahorse’s library.
isNumber : function(cad,
ds,
gs)
Checks if a string represents a number.
isInteger : function(cad,
gs)
Checks if a string represents an integer.
isNumeric : function(cad)
Checks if a string contains only numbers.
isAlphabetical : function(cad)
Checks if a string contains only alphabetical characters (including accents and another not Ascii characters).
isAlphanumeric : function(cad)
Checks if a string contains only alphanumeric characters.
isAlphabeticalAscii : function(cad)
Checks if a string contains only alphabetical ASCII characters.
isAlphanumericAscii : function(cad)
Checks if a string contains only alphanumeric ASCII characters.
isAsciiText : function(cad)
Checks if a string contains only ASCII characters.
isIPv4 : function(ip)
Checks if a string represents an IP version 4 address.
isIPv6 : function(ip)
Checks if a string represents an IP version 6 address.
isEmail : function(mail)
Checks if a string represents an e-mail address.
isHttp : function(http)
Checks if a string represents a HTTP address.
isFtp : function(ftp)
Checks if a string represents a FTP address.
isMonth : function(mes)
Checks if a string represents a month.
isDay : function(dia,
mes,
anio)
Checks if a string represents a day of a particular month.
isDate : function(cad,
format,
fill)
Checks if string represents a date.
isTime : function(cad,
format,
fill)
Checks if string represents an instant of time.
isDateFormat : function(format)
Checks if string is a valid date format.
isTimeFormat : function(format)
Checks if string is a valid time format.
validateForm : function(idForm)
Checks if all the elements of a form have valid values.
passFilter : function(cad,
filter,
contains)
Acording to the value of ‘contains’, checks if all the characters of ‘cad’ are contained in ‘filter’ or if neither of the characters are contained.
parseNumber : function(cad,
ds,
gs)
Parses a string and returns an number.
parseInteger : function(cad,
gs)
Parses a string and returns a integer.
parseIPv4 : function(ip)
Parses a string that represents an IPv4 address and returns a array with four numbers.
parseIPv6 : function(ip)
Parses a string that represents an IPv6 address and returns a array with eight hexadecimal numbers.
parseDate : function(cad,
format,
fill)
Receives a string representing a date and transforms it according to the format passed as parameter.
parseTime : function(cad,
format,
fill)
Receives a string representing an instant of time and transforms it according to the format passed as parameter.
filterString : function(cad,
filter,
contains)
Returns all the characters of ‘cad’ that are contained, or that aren’t contained, in ‘filter’.
compareDate : function(date1,
date2,
dateFormat)
Compare two strings that represents dates.
compareTime : function(time1,
time2,
timeFormat)
Compare two strings that represents times.
serialize : function(form,
notation)
Encode the elements of a form as a string.