Bunoon: TESS | Manual | Input

This area contains a set of functions that are used for handling and manipulating the input areas of a Form, or single input method if defined outside a form area. Have you ever wanted one of your input boxes to select all the text when a user focuses on it?, or only allow certain types of input? All this is available in this section of TESS.

Additional support is available for some functionality available in CSS available features, but they will help ensure that the transformation is forced to apply straight away in all browsers.

Looks up an form element by ID (or just the form element itself) and tries to select all it's available text.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.
  • bFocus [Boolean] - States if the text box should be focused or not (set to true as default).

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bCompleted = $T.Input.SelectAll('txtTextArea', true);

Looks up a form element by ID (or just the form element itself) and tries to get the selected text.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.

The return value for this function is as follows:

  • [Object] - A string containing the selected text (or null if any error has occurred).

Below is an example of how to use this function:

var sSelectedText = $T.Input.GetSelected('txtTextArea');

Looks up a form element by ID (or just the form element itself) and tries assign a function to it's focus event to select all the text.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bSet = $T.Input.SelectAllOnFocus('txtTextArea');

Looks up a form element by ID (or just the form element itself) and tries to set it to only except numbers (and decimals).

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.
  • nInputType [Number] - States the input type that the text box should except.
  • bDisableContextMenu [Boolean] - States if the context menu for the element should be disabled (set to true as default).

The main input types for 'nInputType' (to be passed as a value) are as follows:

  • 0 = [m_INPUT_TYPE_Numbers]
  • 1 = [ m_INPUT_TYPE_Letters]
  • 2 = [m_INPUT_TYPE_PreventEnter]

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bSet = $T.Input.SetInputType('txtTextArea', 0);

Looks up a form element by ID (or just the form element itself) and tries to set it to only show uppercase characters.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bCompleted = $T.Input.AlwaysUpperCase('txtTextArea');

Looks up a form element by ID (or just the form element itself) and tries to set it to only show lowercase characters.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bCompleted = $T.Input.AlwaysLowerCase('txtTextArea');