The text question type collects a free-text response — any string of characters. It is the most flexible input type and is used for names, addresses, descriptions, codes, and anything that does not fit a more specific type.

rtSurvey also extends text with time input widgets that allow precise time entry with a clock picker.

Basic XLSForm Specification

typenamelabel
textrespondent_nameFull name of respondent
textaddressHome address

For more details on the standard XLSForm text type, see the XLSForm specification.

Uses

Text questions are used for:

  1. Names, addresses, free descriptions
  2. Open-ended comments or feedback
  3. Codes, IDs, or reference numbers that do not fit integer/decimal
  4. Collecting time values with rtSurvey’s time input extensions
  5. Autocomplete text fields (via search-autocomplete-noedit-v2())

Standard appearance options

AppearanceDescription
(none)Single-line text input
multilineMulti-line text area — best for longer free text on web

rtSurvey time input extensions

rtSurvey extends text with a clock picker widget for collecting time values. These appearance options display a clock icon the enumerator can tap to select hours, minutes, seconds, or milliseconds.

Appearance variants

AppearanceDescription
inlineClock icon displayed next to the field
inline colors("RRGGBB")Clock icon with custom hex color
inline-1lineClock displayed in a compact single-row format
inline-1line-RRGGBBSingle-row with custom icon color (hex, no #)
inline-1line colors("RRGGBB","RRGGBB")Single-row with two colors
inline-onlyresultClock icon disappears after selection; only the value is shown
inline-onlyresult colors("RRGGBB")Same, with custom icon color

Time format tokens

Append a format string in brackets to control which time components are shown:

Format stringDisplays
inline-[%H:%M]Hours and minutes (24-hour)
inline-[%h:%M]Hours and minutes (12-hour)
inline-[%H:%M:%S]Hours, minutes, seconds (24-hour)
inline-[%h:%M:%S]Hours, minutes, seconds (12-hour)
inline-[%H:%M:%3]Hours, minutes, milliseconds
inline-[%M:%S]Minutes and seconds only
inline-[%M:%3]Minutes and milliseconds only
inline-[%S]Seconds only
inline-[%3]Milliseconds only
inline-[%H]Hours only (24-hour)
inline-[%h]Hours only (12-hour)

Example: Record a task duration in minutes and seconds

typenamelabelappearance
texttask_durationTime taken to complete the taskinline-[%M:%S]

Example: Record an event time in 24-hour format with custom color

typenamelabelappearance
textevent_timeTime of eventinline-1line colors("0099FF")

Data format

Text data is stored and exported as a plain string. For time-based inputs using the inline clock widget, the value is stored in the format matching the chosen format string (e.g., 14:32 for %H:%M).

Constraints and validation

Apply constraints to enforce format, length, or pattern:

typenamelabelconstraintconstraint_message
textnameFull namestring-length(.) >= 2Name must be at least 2 characters
textcodeReference coderegex(., '^[A-Z]{2}[0-9]{4}$')Enter 2 uppercase letters followed by 4 digits
textphonePhone numberregex(., '^[0-9]{9,15}$')Enter a valid phone number

Best Practices

  1. Use more specific types (integer, decimal, date) whenever the data has a known structure — this prevents invalid entries and simplifies analysis.
  2. Add constraint with string-length() or regex() to validate codes or IDs.
  3. Use multiline appearance for open-ended questions where respondents may write several sentences.
  4. For time collection, choose the time format tokens that match the precision your analysis requires — collecting milliseconds when you only need minutes wastes enumerator effort.

Platform support

The text question type and all time input appearances are supported on iOS, Android, and web platforms.

Limitations

  • Text responses are free-form — there is no built-in spell check or vocabulary constraint beyond regex patterns.
  • The inline time widget is an rtSurvey extension and is not part of the standard XLSForm specification.
Беше ли полезна тази страница?