Text Question Type

Last Updated: 17 Dec 2015

The Text Question
The Text question type

The Text question type allows the user to enter text for the question. You can change this field from a single line (as shown in the figure to the right) to a multiple line box.

Bookmarks to the headings on this page:

  1. Details Screen

Details Screen

The Details screen allows you to configure the settings of the Text question.

Question Options

This section allows you to customise the options for your Text question. The Question Options section is shown in the figure below:

The Question Options section for a Text Question Type
The Question Options section

The following fields are available:

  • The Text Question asset
    The question asset

    Title: enter the question title, for example Name. When you change the Title of the question, the asset name will change in the Asset Map, as shown in the figure to the right. This Title will appear on the Custom Form as the name of the question.
  • Note: enter a note to be displayed for the question on the Custom Form. This can be used to provide information to your users about the question and the expected form of the response. For example Please enter your name.
  • Default Value: enter the default value for the question. This will be displayed within the answer field on the form. The user can then override this value.

    Tip: You can use the keyword replacement as the Default Value. This will default the user's name into this question on the form if the user is logged into your site.

  • Placeholder: enter a placeholder value, i.e. a short hint describing the expected value of the input field. The value entered into this field will be displayed in the input field before the user enters a value.

    Internet Explorer users should note that the placeholder attribute is currently only supported in IE10 and above.

  • Input Type: specify the input type of the response field. When using a HTML5 compatible browser, the input field will provide specific interfaces to suit the specified the field type. The input types available are:
    • Color
    • Date
    • Datetime
    • Datetime-local
    • Email
    • Hidden
    • Month
    • Number
    • Range
    • Search
    • Text
    • Tel
    • Time
    • Url
    • Week

    By default, the input type will be set to 'Text'.
  • Width: enter the width of the text field to be displayed on the Custom Form. By default, this value is 30.
  • The Height option of a Text Question
    The Height Option

    Height: enter the number of rows for the question. By default, this value is 1 meaning that the field on the form will be one row. If 2 or more is entered, the text field changes into a multiple line box as shown in the figure to the right.
  • Maximum Length: enter the maximum number of characters that can be entered by the user. If this value is bigger than the Width, the visible portion of the field scrolls as the user types into the field. By default, this value is 300.
  • Tab Index: enter the tab index for the Text question on the Custom Form. This index is used when the user press the Tab key on the keyboard. This is useful when you have laid out each question individually on the Page Contents Bodycopy. If this question is the first question on the Custom Form, but on the Page Contents Bodycopy you have put it last, you can enter the Tab Index so that when the user presses the Tab key, it will be the last question the cursor goes to.
  • Extras: enter any additional HTML attributes to be added to the tag used to display the answer field for the question. For example, you may wish to specify a CSS class that defines the formatting of the question text.
  • Sticky: select Yes to define the answer to this question as sticky for the remainder of this users session. If this option is set to Yes, the most recent value entered into this question is marked as sticky and will be used to pre-fill other forms with a question of the same name that also have the Sticky flag set to Yes. Any sticky value will override the default value for the question.
Simple Validation Rules

The Simple Validation Rules section of the Details screen allows you to select whether or not this question is mandatory. For more information on how the fields that are available, refer to the Questions chapter in this manual.

Complex Validation Rules

The Complex Validation Rules section of the Details screen allows you to add additional validation rules to the select question. For more information on how to add a rule, refer to the Questions chapter in this manual. The complex validation rules that are available for the select question are as follows:

  • Regular Expression: this rule allows you to specify a regular expression that is compared against the answer that is entered by the user for this question. The fields that are available for this rule are shown in the figure below.

    The Regular Expression Complex Validation Rule for a Text Question
    The Regular Expression Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must match the regular expression or Must not match the regular expression.
    • Regular expression: enter the regular expression that the answer must match or must not match. For further information about the syntax for a regular expression you can either click on the link available in the Note field within the Complex Validation Rules section or visit the PHP: PCRE Manual.
    • Case Sensitive: check this box to use case-sensitive matching. By default, this is ticked on.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to question "Name" is not in the correct format.
    • Delete?: to delete this validation rule, click the Delete box and click Commit.
  • Value Comparison: this rule allows you to specify that the answer entered must be or must not be equal to the value specified. You can enter either a string value or select a question from the Custom Form for the value to compare to. The fields that are available for this rule are shown in the figure below.

    The Value Comparison Complex Validation Rule for a Text Question
    The Value Comparison Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must be equal to, Must NOT be equal to, Must be greater than, Must be less than, Must be greater than or equal to or Must be less than or equal to.
    • Static Value: enter the value for the comparison.
    • OR Value of Question: select the question from the form that the answer must or must not equal.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must be equal to "a".
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Numeric Value: this rule allows you to specify that the answer that the user enters must be a numeric value. For example, if this question was being used for a phone number, you can specify that the user can only enter numeric values. The fields that are available for this rule are shown in the figure below.

    The Numeric Value Complex Validation Rule for a Text Question
     The Numeric Value Complex Validation Rule

    The fields that can be set up are as follows:
    • Condition: select from Must be numeric or Must not be numeric.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to question "Name" must a valid numeric value.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Text Found In: this rule allows you to specify that the answer entered must be found or must not be found in the value specified. You can enter either a string value or select a question from the Custom Form for the value to compare to. The fields that are available for this rule are shown in the figure below.

    The Text Found In Complex Validation Rule for a Text Question
    The Text Found In Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must be found in or Must not be found in.
    • Static Value: enter the value for the comparison.
    • OR Value of Question: select the question from the form that the answer must or must not be found in.
    • Case Sensitive: check this box to use case sensitive matching. By default, this is selected.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must be found in "test" (case sensitive).
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Text Contains: this rule allows you to specify that the answer entered must contain or must not contain the value specified. You can enter either a string value or select a question from the Custom Form for the value to compare to. The fields that are available for this rule are shown in the figure below.

    The Text Contains Complex Validation Rule for a Text Question
    The Text Contains Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must contain or Must not contain.
    • Static Value: enter the value for the comparison.
    • OR Value of Question: select the question from the form that the answer must or must not be contained in.
    • Case Sensitive: check this box to use case sensitive matching. By default, this is selected.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must contain "a" (case sensitive).
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Length Comparison: this rule allows you to specify that the length of the answer entered must be a certain number of characters. For example, if this question is for a mobile phone number it must be at least 10 characters long. The fields that are available for this rule are shown in the figure below.

    The Length Comparison Complex Validation Rule for a Text Question
    The Length Comparison Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must be this many characters in length, Must not be this many characters in length, Length must be greater than this many characters, Length must be less than this many characters, Length must be at least this many characters, or Length must be no more than this many characters.
    • Number of characters: enter the number of characters the value must or must not be.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The length of the response to "Name" must be 4 character(s).
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Valid Email: this rule allows you to specify that the value entered into this field must be or must not be a valid email address.

    Tip: An email address question type is available on a Custom Form. This question type already has the required email validation built into it by default.

    The fields that are available for this rule are shown in the figure below.

    The Valid Email Complex Validation Rule for a Text Question
    The Valid Email Complex Validation Rule  

    The fields that can be set up are as follows:
    • Condition: select from Must a valid email address or Must not be a valid email address.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Email" must be a valid email address.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Value Begins With: this rule allows you to specify that the answer entered must begin with or must not begin with the value specified. You can enter either a string value or select a question from the Custom Form for the value to compare to. The fields that are available for this rule are shown in the figure below.

    The Value Begins With Complex Validation Rule for a Text Question
    The Value Begins With Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must begin with or Must not begin with.
    • Static Value: enter the value for the comparison.
    • OR Value of Question: select the question from the form that the answer must or must not begin with.
    • Case Sensitive: check this box to use case sensitive matching. By default, this is selected.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must begin with "a" (case sensitive).
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Value Ends With: this rule allows you to specify that the answer entered must end with or must not end with the value specified. You can enter either a string value or select a question from the Custom Form for the value to compare to. The fields that are available for this rule are shown in the figure below.

    The Value Ends With Complex Validation Rule for a Text Question
    The Value Ends With Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from Must end with or Must not end with.
    • Static Value: enter the value for the comparison.
    • OR Value of Question: select the question from the form that the answer must or must not end with.
    • Case Sensitive: check this box to use case sensitive matching. By default, this is selected.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must end with "a" (case sensitive)'.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Word Count Comparison: this rule allows you to specify that the answer entered must be a certain number of words. For example, if you want a response to only be allowed if it is twenty-five words or less. The fields that are available for this rule are shown in the figure below.

    The Word Count Comparison Complex Validation Rule
    The Word Count Comparison Complex Validation Rule

    The fields that can be set up are as follows:
    • Operator: select from either Must be this many words in lengthMust not be this many words in lengthLength must be greater than this many wordsLength must be less than this many wordsLength must be at least this many words and Length must be no more than this many words.
    • Number of Words: enter the number of words that the value must or must not be.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show on the form if this rule fails. If you do not enter an error message, a default message will appear similar to The response to "Name" must end with "a" (case sensitive)'.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.