Pular para o conteúdo principal
Base de Conhecimento da FocusVision

Data Verifiers

Open-ended questions like <text>, <textarea> and <number> questions come equipped with the verify attribute. Use this attribute at the question or question element level to restrict responses to a certain format.

1:  Overview

The verify attribute uses regular expressions to check the alpha-numeric content of a respondents' response. If applied at the question level, the responses for each input will be checked against the regular expression and must match in order to be accepted. As illustrated below, the verify attribute can also be applied at the row or column level and there are a number of built-in verifier functions to choose from.

<text label="..." title="Enter your email address below." verify="email"/>

<text label="..." title="Fill in the information below.">
    <row label="name"  verify="len(1, 32)">First Name</row>
    <row label="phone" verify="phoneUS">Phone #</row>
    <row label="zip"   verify="zipcode">Zip Code</row>
</text>

<text label="..." title="Which year were you born?" verify="digits;len(4);range(1900,2014)"/>

The last example above demonstrates the ability to stack verifier functions.

2:  Using Verifier Functions in Builder

First create the question in Builder, then click the drop-down menu on the right options panel to choose a verifier.

Finally, test the survey to confirm the question functions correctly. In this example we are testing the "Email" verifier and if the email address is not in the form user@domainname.ext, you will receive an error message similar to the example below.

3:  Built-In Verifier Functions

The table below provides a list of the available verifier functions.

Verifier Description
Email

Scope: <text>, <textarea>

Example: verify="email"

The data entered must resemble an email address. In short, it should contain the @ symbol followed by a dot and ending with 2 - 4 characters.
(e.g. user@domain.com)

US Zip Code

Scope: <text>, <textarea>

Example: verify="zipcode"

The data entered must be 5 digits long.
(e.g. 93722)

Zip Code w/Extension

Scope: <text>, <textarea>

Example: verify="zipcodeExt"

The data entered must be 5 digits immediately followed with a hyphen and 4 digits.
(e.g. 93722-1234)

Number Range

Scope: <text>, <textarea>, <number>

Example: verify="range(MINIMUM, MAXIMUM)"

The data entered must fall in the range provided. Note that the minimum and maximum values provided exist within the set of accepted inputs.
(e.g. range(1, 100) accepts values 1, 2, 3, ... , 99, 100)

Digits

Scope: <text>, <textarea>

Example: verify="digits"

The data entered must be a number, using only roman digits 0 - 9.
(e.g. 1, 123, 9001)

Number

Scope: <text>, <textarea>, <number>

Example: verify="number"

The data entered must be a number, integer or decimal.
(e.g. 100, 10.0, $10, 10.00, 1,000)

The following characters are ignored and will be accepted as input: $ , .

US Phone Number

Scope: <text>

Example: verify="phoneUS"

The data entered must be a 10-digit US phone number. (e.g. 559123456)

Response Length

Scope: <text>, <textarea>, <number>

Example: verify="len(MIN_LENGTH)"
Example: verify="len(MIN_LENGTH, MAX_LENGTH)"

The data entered must be a certain number of characters in length, or at least a certain number of characters in length.
(e.g. len(5) ensures that at least 5 characters are entered, len(5,10) ensures that at least 5 and at most 10 characters are entered)

  • Este artigo foi útil?