string.comp

The String widget is used for input fields that contain a strings.
The string length can be defined in the .mql file or preferably directly in the database.

Input Parameters:

The widget's two main parameters are:

Input Parameter Description Default Value
rows Displays <input> field when the $rows value is not specified or its value is one.
Displays <textarea> when the $rows value is greater than one.
Undefined.
value Input string. Empty string.

Besides displaying the input field the component also connects it with interactive functionality setting the:
onkeypress, onkeydown, onchange, onmouseover, onmouseout to related function names from the string.js.

See also String Length example.

Parameters Passed To <input> Tag

Input Parameter Description Default Value
id ID value. Undefined.
length Value of the maxlength. 12
size Value of the size. int($length)
width Helps construct value of the style. Undefined.
password Helps construct value of the type. Undefined.
readonly If it's defined it sets the tag to readOnly. Undefined.

Parameters Passed To <textarea> Tag

Input Parameter Description Default ValueSorted ascending
length The default value of the cols parameter. 12
cols Value of the cols parameter. ceil($length/$rows) otherwise undefined.
id ID value. Undefined.
width Helps construct value of style parameter. Undefined.
readonly If it's defined it sets the tag to readOnly Undefined.

Parameters Passed To Input_String_Init() Function

Input_String_Init() function creates JavaScript object using Input_Init() from input.comp and sets its properties.

Input Parameter Description Default Value
id Object name. Undefined.
description Object tooltip. Empty string.
length Obj.maxLength 12
valid_chars Obj.validChars regular expression determines which pressed keys to validate. '.*'
ignore_chars Obj.ignoreChars regular expression determines which pressed keys to ignore . Empty string.
trim Obj.trim string configures how to trim the input string:
* R - trim the right side spaces.
* L - trim the left side spaces.
* <other_character> - trim any other characters from the string.
$r->dir_config('String_TrimDefault');
trans Obj.trans string configures how to translate the input string:
* U or u - converts the input string to upper case.
* L or l - converts the input string to lower case.
Undefined.
Topic revision: r7 - 14 Mar 2024, GuidoBrugnara
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies