Instance Settings
Customise each targetted field with the settings below (all are optional):
$(selector).keypad({randomiseNumeric: true});
appendText | beforeShow | buttonImage | buttonImageOnly | duration | keypadClass | keypadOnly | layout | onClose | onKeypress | prompt | randomiseAll | randomiseAlphabetic | randomiseNumeric | randomiseOther | separator | showAnim | showOn | showOptions| target| useThemeRoller
Name | Type | Default | Comments |
---|---|---|---|
showOn | string | 'focus' | Control when the keypad is displayed: 'focus' for only on focus of the text field, 'button' for only on clicking the trigger button, or 'both' for either. |
buttonImage | string | '' | The URL of an image to use for the trigger button. |
buttonImageOnly | boolean | false | Set to true to indicate that the trigger image should appear by itself and not on a button. |
showAnim | string | 'show' | Set which animation is used to display the keypad. Choose from three standard
animations: 'show', 'fadeIn', or 'slideDown', or use one of the
jQuery UI effects
if you include that package. For no animation use ''. Since 1.2.3 - use '' for no animation. |
showOptions | object | null | If you use one of the jQuery UI effects for the animation above,
you can supply additional options for that effect via this setting.
|
duration | string | 'normal' | Control the speed of the show/hide animation with this setting: 'slow', 'normal', 'fast', or a number of milliseconds. |
appendText | string | '' | Text that is to be appended to all affected fields, perhaps to describe the presence or purpose of the keypad. |
useThemeRoller | boolean | false | Set to true to add ThemeRoller
classes to the keypad to allow the keypad to integrate with other UI
components using a theme. Since 1.3.0. |
keypadClass | string | '' | One popup keypad is shared by all instances, so this setting allows you to apply different CSS styling by adding an extra class to the keypad for each instance. |
prompt | string | '' | Text that is displayed at the top of the keypad. The value may include HTML markup. |
layout | string[] | $.keypad.numericLayout | Set the layout of the keypad by defining the characters present on each row.
All alphabetic characters should be in lower case.
Make use of the keypad constants to add special features into the layout:
Use the regional settings to set what is shown for each of these buttons. Since 1.2.0 - added SPACE_BAR .Since 1.2.4 - added ENTER .Since 1.4.0 - added TAB . |
separator | string | '' | The character that separates the text content of the keys,
used in conjunction with the layout setting.
By default it is blank, so each key contains only one character.
Since 1.2.0. |
target | element or jQuery or string | null | When using an inline keypad you can set this field to an input field
to have the keypad update it automatically. The value can be either the element
itself, a jQuery wrapper around the element, or the jQuery selector for it.
When null use the onKeypress
callback instead.Since 1.2.1. |
keypadOnly | boolean | true | Set to true to indicate that only the keypad can be used to enter text, or false to allow normal entry as well. This option does not apply to inline keypads. |
randomiseAlphabetic | boolean | false | Set to true to indicate that the alphabetic characters in the layout
should be randomised for each display. The isAlphabetic
setting determines which characters are alphabetic. |
randomiseNumeric | boolean | false | Set to true to indicate that the numeric characters in the layout
should be randomised for each display. The isNumeric
setting determines which characters are numeric. |
randomiseOther | boolean | false | Set to true to indicate that the non-alphanumeric characters in the layout should be randomised for each display. |
randomiseAll | boolean | false | Set to true to indicate that all characters in the
layout should be randomised for each display.
When true, this setting overrides the other randomise settings. Since 1.0.2. |
beforeShow | function | null | A function that is called after the keypad is constructed but before it is displayed,
allowing you to update it. For example, you could add extra buttons that
perform tasks outside the scope of the normal keypad.
The function receives the division to be displayed and the keypad instance
object as parameters, while this refers to the text field.
Since 1.2.0. |
onKeypress | function | null | A function that is called when a key is pressed on the keypad.
The function receives the current key value ($.keypad.BS
for the Back key, $.keypad.DEL for the
Clear key, and '' for other control keys),
the full field value, and the keypad instance object
as parameters, while this refers to the text field.
Of course, you can still have an onchange handler
for the input field itself.
Since 1.2.0 - added current key parameter.Since 1.2.1 - added $.keypad.BS and
$.keypad.DEL characters for Back and Clear keys. |
onClose | function | null | A function that is called when the keypad is closed.
The function receives the current field value and the keypad instance object
as parameters, while this refers to the text field.
|