Core Docs | Additional Modules Docs
@Description: Fires when the input is validated and it is invalid
@File: forms/inputValidator.js
@Param: input The input that is valid
@Example:validator.onInValid = function(input){
input.style.backgroundColor = 'red';
};
@Description: Fires when the input is validated and it is invalid
@File: forms/inputValidator.js
@Param: input The input that is valid
@Example:validator.onKeyDown = function(e){};
@Description: Fires when the input is validated and it is invalid
@File: forms/inputValidator.js
@Param: input The input that is valid
@Example:validator.onKeyUp = function(e){};
@Description: Fires when the input is validated and it is valid
@File: forms/inputValidator.js
@Param: input The input that is valid
@Example:validator.onValid = function(input){
input.style.backgroundColor = 'lime';
};
@Description: Validate a specific input
@File: forms/inputValidator.js
@Param: input The input that is valid
@Example:validator.validateInput('#myInput');
@Description: Used to validate all named elements contained within a specific
element that have a validate property and name attribute
@File: forms/inputValidator.js
@Param: el The parent element container
@Example:var valid = validator.validateNamedChildrenWithin('#myDiv');
@Description: Used to validate inputs
@File: forms/inputValidator.js
@Param: Object
validateOnKeyUp boolean should validations occurr on keyup
validator regex or function with input as argument, these are executed or matched when the input is validated
onValid(input) function Fires when the input is validate if it is valid
onInValid(input) function Fires when the input is not validate
@Example:var eg1 = new sb.validation({
validator : /^\d\.\d{2}$/,
errorMessage : 'Sorry this does not match an acct number e.g. 4.32'
});
var eg2 = new sb.validation({
validator : function(input){
return input.value != 'ff';
},
errorMessage : 'Sorry the value is not ff'
});
@Description: Validates inputs based on validate attribute
@File: forms/inputValidator.js
@Param: Object
validateOnKeyUp boolean should validations occurr on keyup
validations object of regex or function properties, these are executed or matched when the input is validated
onValid(input) function Fires when the input is validate if it is valid
onInValid(input) function Fires when the input is not validate
@Example:var validator = new sb.forms.inputValidator({
validations : {
acct : new sb.validation({
validator : /^\d\.\d{2}$/,
errorMessage : 'Sorry this does not match an acct number e.g. 4.32'
}),
phone : new sb.validation({
validator :/^\d{3}-\d{3}-\d{4}$/,
errorMessage : 'Sorry this does not match a phone number e.g. 716-877-9999'
}),
email : new sb.validation({
validator : /\b(^(\S+