Options
All
  • Public
  • Public/Protected
  • All
Menu

Keypad related constants and utility method available on the $.keypad object.

Hierarchy

  • KeypadGlobals

Index

Properties

BACK: string

The button to erase the previous character

CLEAR: string

The button to clear the input field

CLOSE: string

The button to close the keypad

ENTER: string

The button to add a carriage return

HALF_SPACE: string

Blank space equivalent to half a key

SHIFT: string

The button to toggle between upper/lower case characters

SPACE: string

Blank space equivalent to one key

SPACE_BAR: string

An extended space character

TAB: string

The button to add a tab character

numericLayout: string[]

The standard numeric button layout. This is the default value for the layout setting.

since

2.0.0

qwertyAlphabetic: string[]

The alphabetic character layout for the standard Qwerty keyboard. This is the default value for the alphabeticLayout setting.

qwertyLayout: string[]

The full keyboard layout for the standard Qwerty keyboard. This is the default value for the fullLayout setting.

since

1.2.0 - Reordered and space bar added.

since

1.2.4 - Enter added

since

1.4.0 - Tab added

regionalOptions: Record<string, Record<string, RegionalSettings>>

The set of regional settings for the keypad fields. Entries are indexed by the country or region code with the empty string providing the default (English) settings. Each entry is an object with the localized messages. Language packages load new entries into this array and automatically apply them as global defaults.

<script type="text/javascript"  src="jquery.keypad-fr.js"></script>

If necessary, you can then revert to the default language settings with

$.keypad.setDefaults($.keypad.regionalOptions[""]);

and apply the language settings to individual fields with

$("#frenchKeypad").keypad($.keypad.regionalOptions["fr"]);
since

2.0.0 - previously called regional.

Methods

  • addKeyDef(id: string, name: string, action: ((this: HTMLInputElement, instance: KeypadInstance) => void), noHighlight?: boolean): void
  • Define a new action key for use on the keypad. Up to 32 keys may be defined, including the built-in ones.

    $.keypad.addKeyDef("UPPER", "upper", function(inst) {
    this.val(this.val().toUpperCase()).focus();
    });
    $("#keypad").keypad({
    upperText: "U/C",
    upperStatus: "Convert to upper case",
    layout: [
    "abc" + $.keypad.CLOSE,
    "def" + $.keypad.CLEAR,
    "ghi" + $.keypad.BACK,
    "jkl" + $.keypad.UPPER
    ]
    });
    since

    1.4.0

    Parameters

    • id: string

      Name of the variable to use to include this key in a layout.

    • name: string

      Name used for a CSS styling class for the key (keypad-<name>) and for finding its display text (using <name>Text and <name>Status).

    • action: ((this: HTMLInputElement, instance: KeypadInstance) => void)

      Code to be run when the key is pressed. it receives the keypad instance as a parameter, while this refers to the attached input field,

    • Optional noHighlight: boolean

      true to suppress the highlight class when using ThemeRoller styling.

    Returns void

  • insertValue(input: string | HTMLElement | JQuery<HTMLElement>, value: string): void
  • Insert text into an input field at its current cursor position. This replaces text if a selection has been made.

    Parameters

    • input: string | HTMLElement | JQuery<HTMLElement>

      An input element into which to insert the given value. May be either an element or a CSS selector.

    • value: string

      The text to insert.

    Returns void

  • isAlphabetic(character: string): boolean
  • Default test for English alphabetic characters - accepting "A" to "Z" and "a" to "z". See also the isAlphabetic setting.

    Parameters

    • character: string

      A character to check.

    Returns boolean

    true if the given character is contained in the set of alphabetic characters, or false otherwise.

  • isNumeric(character: string): boolean
  • Default test for English numeric characters - accepting '0' to '9'. See also the isNumeric setting.

    Parameters

    • character: string

      A character to check.

    Returns boolean

    true if the given character is contained in the set of numerical characters, or false otherwise.

  • Update the default instance settings to use with all keypad instances.

    Parameters

    Returns void

  • toUpper(character: string): string
  • Convert a character into its upper case form - using the standard JavaScript toUpperCase function. See also the toUpper setting.

    since

    1.5.0

    Parameters

    • character: string

      A character to convert to upper case.

    Returns string

    The given character, converted to upper case, or the given character itself, if it cannot be converted.

Generated using TypeDoc