The maxlength
(alias maxlen
) and minlength
(alias minlen
) tags are applied to open-ended questions to specify the max or minimum number of characters that can be accepted for a response. These tags can be used separately or together.
1. What adjective would you use to describe your mood today?
type: text
maxlength: 15
1A. Why do you feel that way?
type: textbox
minlength: 15
maxlength: 300
Details
- The
maxlength
andminlength
tags can be applied to text, textbox, and numeric questions and tables. - Questions that include
maxlength
will have the text field or textbox automatically sized to a "reasonable" width based on the number of characters specified. To further restrict the field width, include thesize
tag. - Including
maxlength
on a numeric input question will automatically restrict the maximum accepted value. For example,maxlength: 3
will accept '999' as the greatest value. To further restrict the accepted values, e.g., 1-100, include therange
tag. - Commas, decimals, and other punctuation will count towards a
maxlength
restriction. - When using
maxlength
with textbox questions/tables, you can includetemplate: char_remain.tx
so the respondent will see a real-time countdown for the number of remaining characters allowed for their answer. - If a
minlength
response length is not met, a message will appear asking the respondent to "Please be more specific."
Additional tags
The following tags are commonly used with the maxlength
and minlength
tags.
Tag | Description |
datatype |
Specifies the type of values accepted for responses. Commonly used datatypes include 'number', 'whole', or 'integer'. |
instruct |
Provides instructions to the respondent separate from the question text. |
numberformat |
Specifies formatting for a numerical response, such as including commas in large numbers ('0,0') or the number of decimal places to allow ('0.00'). Note that commas and decimals will count toward a specified max length. |
postfix |
Displays text before the text field or textbox. |
prefix |
Displays text after the text field or textbox. |
range |
Specifies maximum and/or minimum limits for a numeric response, e.g., |
size |
Specifies the width in ems of the text field/textbox. The size tag takes precedence over the maxlen tag for display purposes. |
Note: If using the maxlength
or minlength
tags with autoother parameters
, be sure to use the full tag name.
Comments
0 comments
Please sign in to leave a comment.