Single Line Text Fields

Caldera Forms Banner

Single line text fields are the most common types of fields found in Caldera Forms. These fields are used for capturing single line data such as name, last name or any other information you would be able to capture in one line.

Single line text fields have various HTML type options which helps capturing the correct type of data by using HTML 5 validation. For example, you may want to capture time or the week, you are able to set the HTML type to accept time, date, week format or keep it as a simple text field.

How To Set The HTML Type Of A Text Field

HTML type options available for single line text field
HTML type options available for single line text field

By default, single line text fields use the “text” type. Other HTML5 type attributes are supported. Capturing the correct type of data for single line text fields are simple with Caldera Forms. Once you have added your single line text field to your form builder within the WordPress dashboard, edit the text field and select the relevant HTML type option which is a dropdown near the bottom of the field editor.

Please note that not all browsers support these types, and not all HTML5 types are supported by all browsers. Your site must properly declare the HTML5 doctype.

HTML5 Types Explained

  • Text – The default field type, accepts all characters.
  • Date – Accepts ‘yyyy-mm-dd’ format
  • Datetime – Accepts ‘yyyy-mm-dd hh:mm AM/PM’ based on UTC time with 12 hour formatting.
  • Datetime local – Accepts ‘yyyy-mm-dd hh:mm AM/PM’ based on users time with 12 hour formatting.
  • Month – Accepts ‘month name and year (M Y)’.
  • Number – Accepts numbers only.
  • Search – Sets the field type to be used for searching strings and numbers.
  • Tel – Accepts numbers only.
  • Time – Accepts ‘hh:mm AM/PM’ with 12 hour formatting.
  • URL – Accepts only valid URLs such as www.calderaforms.com.
  • Week – Accepts ‘week number and year’.

You are able to take control and extend onto the HTML5 type option over and above by using mask input settings.

What Is Mask Input In Caldera Forms?

Mask input allows users to take control of what users are able to insert into a text field by making use of wildcard characters to define the data types and format of the field that is accepted. For example, you may want users only to be able to insert any amount of characters a space and one number for example Caldera 1 the mask input would be [{a* 9}]. To break down the mask input, allow any amount of characters with a space at the end and any number (0 – 9) only.

Here are some examples, which can be found inside your field editor once selecting the Mask Input option :

e.g (aaa-99-999-a9-9*)

  • 9 : numeric
  • a : alphabetical
  • * : alphanumeric
  • [9 | a | *] : optional
  • {int | * | +} : length

Any length character only: [a{*}]

Any length number only: [9{*}]

email: *{+}@*{2,}.*{2,}[.[a{2,}][.[a{2,}]]]

As you can see by the email mask input, you are able to combine multiple mask inputs into one.