Skip to content

Text Field

Text fields store a single line of text. This page covers the options available when editing a text field in the Field Editor.

Field label

The text displayed beside the field when editing a record.

Database Field

The name the database and program use to refer to the field. In viewers you reference it as:

<?php echo $record['fieldname'] ?>

If you rename an existing field, update any references to it in your viewers and Database Editor settings. Some field names have special built-in behavior. See Special Fieldnames.

Field type

The type of input the field accepts. Each field type has different options. Note that the separator field type doesn’t require a field label or field name.

Help tooltip

Displays a help icon after the field label; hovering over it shows this message as a tooltip.

Show for

Limits who can see and edit the field: Everyone, Editors and admins, Admins only, or Nobody. Users without access don’t see the field when creating, modifying, or viewing records (new records save the default value), and the field isn’t shown as a list column.

Show if

Shows or hides the field on the record edit page based on another field’s value. Pick a field, an operator, and a value. Operators are equals, does not equal, contains, starts with, and ends with (is checked / is not checked for checkbox fields). Use | between values to match any of several (e.g. draft|pending); for multi-value fields, any matching value counts.

Select Custom expression for AND conditions and multi-field rules, using =, !=, *= (contains), ^= (starts with), and $= (ends with) as operators, e.g. type=article AND status!=draft|pending. AND binds tighter than OR, field= matches empty or unchecked, and field!= matches any value.

Options specific to the field type appear in this section. For most fields the defaults will be sufficient, but for list fields you will need to set the values for your list options.

Default value

The default value the field shows when creating a new record.

Existing records

Shown only when adding a new field. Check “Update all existing records with the default value above” to fill the new column for existing records; otherwise existing records get NULL.

Field prefix

Text displayed before or above the field.

Field description

Text displayed after the field.

Placeholder

Grey hint text shown inside the field when it’s empty.

Field addons

Text displayed attached to the start or end of the input, such as $ before a price or kg after a weight.

Password field

Hide text that users enter, showing values as stars (*****) when the user views or modifies the field.

Field width

The width of the field, chosen from a preset dropdown: Tiny, Small, Medium, Large, or Full Width. Leave unselected for the default width.

Required

Requires the user to enter a value for the field, showing an error if the field is left blank.

Unique

Requires the user to enter a unique value for the field, showing an error if another record has the same value.

Length

The minimum and maximum length for the field value, in characters. An error is shown if the value is shorter or longer. Leave either input blank for no limit.

Characters

Controls which characters can be entered: Allow all, Only allow the characters you specify, or Don’t allow the characters you specify.

System field

System fields cannot be edited and have no modify or erase link unless “System Field Editing” is enabled (under Advanced Commands on the field list page). This prevents accidental changes to fields the program relies on.

MySQL column type

The MySQL column type used to store the field. Auto (the default) picks a type appropriate to the field type; you can also choose from preset text/string, numeric, and date/time types, or enter a custom column type.

MySQL indexing

Creates a MySQL column index for the field, which speeds up sorting and some searches but slows down adding and saving records.

Data encryption

Automatically encrypts data stored in the column. Requires a database encryption key (set on the Security settings page) and the MySQL general query log to be disabled; enabling encryption also sets the column type, which can’t be changed while encryption is on. Back up the database before encrypting, and back up the encryption key. Without it the data is unrecoverable.

The field holds the entered text as a plain string, returned raw with no HTML encoding applied. Generated code wraps it in htmlencode() for output:

<?php foreach ($listingsRecords as $record): ?>
<?php echo htmlencode($record['title']) ?><br>
<?php endforeach ?>

Text fields add no field-type pseudo-fields; every record still carries the standard ones such as _link. See the Pseudo-field Reference.

Documents CMS Builder 3.83