ScriptDoc Reference

Functions

jsValidator.Validator.init() : static 

Initializes the validator

jsValidator.Validator.addValidator(Object elmt) : static 

Add a validator to a field, checks if the field is correct and calls the message functions

Objectelmt

jsValidator.Validator.addValidators(Object elem) : static 

Add more than one validators to a field.

Objectelem

jsValidator.Validator.inlineMsg(Object target, Object string) : static 

Build the message and calls the function to show the message

Objecttarget
Objectstring

jsValidator.Validator.showMsg(Object elmt, String elem) : static 

You can override this function with your own function This function shows the message

Objectelmt: an instance of the message element
Stringelem: the fieldname

jsValidator.Validator.hideMsg(Object elmt, String elem) : static 

This method hides the elemnt

Objectelmt: an instance of the message element
Stringelem: the fieldname

Validators.regex(Object value, Object regex) : static 

Validators.regex This method handles a custom regular expression

Objectvalue
Objectregex

Validators.IsString(Object string) : static 

Validators.IsString() Any string that doesn't have control characters (ASCII 0 - 31) but spaces are allowed

Objectstringvalue: The string to check

Validators._IsString(Object string) : static 

Validators._IsString() Public: same as IsString, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsAlpha(Object string) : static 

Validators.IsAlpha() Public: only letters a-z and A-Z

Objectstringvalue

Validators._IsAlpha(Object string) : static 

Validators._IsAlpha() Public: same as IsAlpha, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsDigit(Object string) : static 

Validators.IsDigit() Public: only numbers 0-9

Objectstringvalue

Validators._IsDigit(Object string) : static 

Validators._IsDigit() Public: same as IsDigit, only now the value is also valid if it is empty

Objectstring$value

Validators.IsAlphaNum(Object string) : static 

Validators.IsAlphaNum() Public: letters and numbers

Objectstringvalue

Validators._IsAlphaNum(Object string) : static 

Validators._IsAlphaNum() Public: same as IsAlphaNum, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsFloat(Object string) : static 

Validators.IsFloat() Public: only numbers 0-9 and an optional - (minus) sign (in the beginning only)

Objectstringvalue

Validators._IsFloat(Object string) : static 

Validators._IsFloat() Public: same as IsFloat, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsInteger(Object string) : static 

Validators.IsInteger() Public: only numbers 0-9 and an optional - (minus) sign (in the beginning only)

Objectstring$value

Validators._IsInteger(Object string) : static 

Validators._IsInteger() Public: same as IsInteger, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsFilename(Object string) : static 

Validators.IsFilename() Public: a valid file name (including dots but no slashes and other forbidden characters)

Objectstringvalue

Validators._IsFilename(Object string) : static 

Validators._IsFilename() Public: same as IsFilename, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsBool(Object string) : static 

Validators.IsBool() Public: a boolean (case-insensitive "true"/"1" or "false"/"0")

Objectstringvalue

Validators._IsBool(Object string) : static 

Validators._IsBool() Public: same as IsBool, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsVariabele(String value) : static 

a valid variable name (letters, digits, underscore)

Stringvalue

Validators._IsVariabele(Object string) : static 

same as IsVariabele, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsPassword(String value) : static 

a valid password (alphanumberic + some other characters but no spaces. Only allow ASCII 33 - 126)

Stringvalue

Validators._IsPassword(Object string) : static 

same as IsVariabele, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsURL(String value) : static 

check for a valid url

Stringvalue

Validators._IsURL(Object string) : static 

same as IsURL, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsEmail(String value) : static 

a valid email address (only checks for valid format: xxx@xxx.xxx)

Stringvalue

Validators._IsEmail(Object string) : static 

same as IsEmail, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsText(String value) : static 

like IsString, but newline characters and tabs are allowed

Stringvalue

Validators._IsText(Object string) : static 

same as IsText, only now the value is also valid if it is empty

Objectstringvalue

Validators.NoHTML(String value) : static 

Check if the value does not contain any HTML

Stringvalue

Validators._NoHTML(Object string) : static 

same as NoHTML, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsPostcode(String value) : static 

is a valid dutch postcode (eg. 9999 AA)

Stringvalue

Validators._IsPostcode(Object string) : static 

same as IsPostcode, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsPhone(String value) : static 

is a valid dutch phone-number

Stringvalue

Validators._IsPhone(Object string) : static 

same as IsPhone, only now the value is also valid if it is empty

Objectstringvalue

Validators.IsIp(String value) : static 

check if it's a valid ip adres

Stringvalue

Validators._IsIp(Object string) : static 

same as IsIp, only now the value is also valid if it is empty

Objectstringvalue