Text Entry Component
Check out the standard help for an overview of the text entry component.
API Examples
// Internally the component is known as "text_entry"
var text_entryComponent1 = findComponent("My Page", "text_entry", "MyTextEntry"); // To retrieve a text_entry component called "MyTextEntry" on a page called "My Page"
var text_entryComponent2 = findComponentInForeground("My Foreground", "text_entry", "MyTextEntry"); // To retrieve a text_entry component in the foreground.
var text_entryComponent3 = createComponent(parentComponent, "text_entry", 0, 0, 100, 100); // to create a text_entry component inside a custom component.
// Retrieving a property
var textOnTextEntry = getProperty(text_entryComponent1, "text");
console.log(textOnTextEntry);
//Setting a property
setProperty(text_entryComponent1, "text", "hello world");Properties
See the shared property list for all properties available for this component.
Properties
See the shared property list for all properties available for this component.
| Property | Type | Description |
|---|---|---|
| enabled | bool | Enable / Disable the component |
| entry_type | string | ‘default’ ‘phone_number’ ’email’ ‘url’ ‘password’ ‘number’ |
| empty_text | string | The text displays when the text is empty. |
| slice_top, slice_bottom slice_left, slice_right | number(Pixels) | Used to preserve the edges of an image when resizing. To quickly find optimal slice values, place a component using the editor and choose ‘Edit Values’. |
| border_scale | number | Proportionally scales the sides, edges and corners of the nine slice image that are set in the editable values of the image used as a base for the component. |
| multiline | bool | Default is false. |
| required_field | bool | Default is false. Form validation Will be failed when the text is empty |
| validation_type | number | 0 – none (default) 1 – phone number regex(‘(\\(\\d{2}\\))?\\d{6,7}’) || regex(‘\\+?\\d{7,14}’) 2 – email 3 – number 4 – custom regex |
| validation_regex | string | Regex to validate the text |
| font_color | string(0x000000 – 0xFFFFFFFF) | A Hex string in the form of RGBA (Red, Green, Blue, Alpha). E.g 0xFF0000FF will be red with 100% opacity. |
| font_size | number (> 0) | The size of the font. Decimal values are allowed. |
| font_filename | string | The filename of a font inside the /fonts folder (e.g vera.ttf). If the font isn’t found the text will disappear. |
| tracking | number | Distance between characters. |
| empty_font_color | string | |
| empty_font_size | number | |
| empty_font_filename | string | |
| empty_tracking | number | |
| text | string | The text of component |
| default_filename | string | Background image when the component is in normal status |
| disabled_filename | string | Background image when the component is in disable status |
| resize_type | ||
| font_align | ||
| empty_font_align |
Events
See the shared event list for all events available for this component.
| Event | Params | Description |
|---|---|---|
| on_focus | ||
| on_typing | ||
| on_tab | ||
| on_enter | ||
| on_before_validation | ||
| on_fail_validation | ||
| on_pass_validation |