Name | Type | Default | ||||||
---|---|---|---|---|---|---|---|---|
arrow | Boolean | true | ||||||
Sets or gets whether the arrow of the hints will be shown. Code examples
Set the
Get the
Try it: arrow is set to false
|
||||||||
animation | String | 'fade' | ||||||
Sets or gets the animation of showing, hiding the hints. Possible Values:
Code examples
Initialize a jqxValidator with the
Get the
Try it: animation is set to 'none'
|
||||||||
animationDuration | Number | 150 | ||||||
Sets or gets the duration of the animation used for showing/hiding the hints. Code examples
Set the
Get the
Try it: animationDuration is set to 3000
|
||||||||
closeOnClick | Boolean | true | ||||||
Sets or gets whether the hints will be closed when the user click on them. Code examples
Set the
Get the
Try it: closeOnClick is set to false
|
||||||||
focus | Boolean | true | ||||||
Sets or gets whether the jqxValidator will focus the first invalid input. Code examples
Set the
Get the
Try it: focus is set to false
|
||||||||
hintType | String | "tooltip" | ||||||
Sets or gets the hint type. Possible values: 'tooltip' and 'label'. Code example
Set the
Get the
Try it: hintType is set to 'label'
|
||||||||
onError | Function | null | ||||||
Sets or gets callback which will be called on validation error. Code examples
Set the
Get the
|
||||||||
onSuccess | Function | null | ||||||
Sets or gets the callback which will be executed on success. Code examples
Set the
Get the
|
||||||||
position | String | 'right' | ||||||
Sets or gets the default position of the hints. Code examples
Set the
Get the
Try it: position is set to 'left'
|
||||||||
rules | Array | [] | ||||||
Sets jqxValidator rules. Format of a single rule is as follows:
Let's look at all different properties of a single rule.
The input property must be selector of the input you want to validate (we recommend to use ids - example: '#userInput'). The message property is the custom message which will popup, on validation error, for the current rule. Action is a string which is the event on which you want to validate the input (for example click, mouseup, blur, keyup...). The rule property is defining the way you want to validate the input. In jqxValidator there are built in rules like: 'ssn', 'email', 'required', 'phone', 'zipCode', 'maxLength=len', 'minLength=len', 'length=max,min'. In the last three validation rules the strings after the "=" are the rule parameters, for example: 'maxLength=13'. You can also write a function for a custom rule. 'ssn' - 'Social Security Number' Requires input like: ___-__-____ 'email' - requires valid e-mail address. 'required' - requires a CheckBox or Radio Button to be checked or any value to be entered in an Input. 'phone' - requires input like: (___)___-____ 'zipCode' - requires a valid zip code like: ___-__-____ 'maxLength=len' - restricts the maximum input characters to 'len'. 'minLength=len' - restricts the minimum input characters to 'len' 'length=min,max' - restricts the input length to a specific range. Hint positions are as follows: 'left', 'right', 'top', 'bottom', 'bottomcenter', 'topcenter', 'topleft', 'topright', 'bottomleft', 'bottomright'. If you wish to set also an offset you can pass the position like: 'topleft:15,3'. This is going to position your message popup in top-left of the input with offset: left - 15px, top - 3px. The last property is hintRender. This is function used for hint rendering. If you don't pass one the default is going to be used. Notice that the position and hintRender are optional. If you don't set them the default values are going to be used. Code examples
Initialize a jqxValidator with the
Custom Rule Definition. The function returns true or false depending on whether the input is correct or not.
Set the hintRender property of a rule.
|
||||||||
rtl | Boolean | false | ||||||
Sets or gets a value indicating whether the validation messages are displayed from the left side instead of the right. Code example
Set the
Get the
Try it: rtl is set to true
|
||||||||
Events |
||||||||
validationError | Event | |||||||
This is triggered when the form is validated with some errors. Code examples
Bind to the
|
||||||||
validationSuccess | Event | |||||||
This is triggered when the form is validated whithout any errors. Code examples
Bind to the
|
||||||||
Methods |
||||||||
hideHint | Method | |||||||
Hide all hints for a specific input.
None Code example
Invoke the
|
||||||||
hide | Method | |||||||
Hiding all hints for the current form.
None Code example
Invoke the
|
||||||||
updatePosition | Method | |||||||
Updating the positions of all hints. This is useful for example on window resize.
None Code example
Invoke the
|
||||||||
validate | Method | |||||||
Validating the whole form.
None Code example
Invoke the
Try it: validates the jqxValidator.
|
||||||||
validateInput | Method | |||||||
Validates a single input. This method accepts a single parameter which is selector of the input you want to validate. Notice that this selector should be the same like the one you've passed in the rules array.
None Code example
Invoke the
|