← Back to site
← Previous Next →

Module 3: Form input fields

This module covers the "Frontline" of data entry. In the Unicorn P ecosystem, every input field is more than just an HTML tag; it is a state-aware component that automatically maps its value to the req object in your Backend JS API.

All elements in this module support the standard .upff class for enterprise styling and the icon attribute for visual cues.


3.1 Text & Security

<up-text>

The standard single-line input for alphanumeric data.

<up-password>

A secure input field that masks characters and includes a built-in "eye" icon to toggle visibility.

<up-textarea>

For multi-line text, such as notes, descriptions, or addresses.


3.2 Numeric & Range

<up-number>

A precise numeric input. It automatically prevents non-numeric characters and handles decimal precision.

<up-range>

A horizontal slider for selecting a value within a specific bound.


3.3 Contact Info

<up-phone>

An input specialized for phone numbers, often including automatic formatting or country code selection.

<up-email>

Includes built-in regex validation to ensure the input follows a standard email format before the form can be submitted.


3.4 Selection & Toggles

<up-lov> (List of Values)

The most important selection tool. It links directly to a database-driven list.

<up-select>

A standard dropdown for static or hardcoded options.

<up-checkbox> / <up-chkbox>

Standard boolean toggles. Use up-chkbox for a more compact version in grids.

<up-toggle>

A modern "Switch" style checkbox.

<up-radiobutton>

Used when a user must select exactly one option from a visible list.

<up-checklist>

Renders a list of checkboxes. It returns an array of selected values to the backend.

<up-tagbox>

A sophisticated multi-select field where selected items appear as "tags" (pills) that can be removed.


Architect's Tip for Module 3:

For "Money & Gain" efficiency, always use the id as the database column name. If your table column is customer_name, name your element up-text#customer_name. The Unicorn P engine will then automatically map the value during prepInsert or prepUpdate without any extra code.

Shall we move to Module 4: Date, Time & Scheduling?