Long Text

Edit in →
Survey Creator

A Long Text (or Comment) question is a multi-line text input field that allows users to give detailed responses and share their feelings, experiences, or opinions on a subject. Unlike single- or multi-select questions that offer predefined options, a Long Text question asks respondents to express their thoughts in their own words. This example demonstrates how to create and configure a Long text question. Switch between React, Vue, Knockout, jQuery, and Angular to view the example for your JavaScript framework.

Create a Long Text Question

To create a Long Text form field, define an object with the type property set to "comment" and add it to the elements array. Within this object, specify the question's title and a unique name that identifies the question. Optionally, you can specify a description to appear under the title and a placeholder to display within the comment area.

Resize the Comment Area

The comment area of a Long Text question occupies the height of four rows of text on the screen. If you want to change this number and increase or decrease the height, set the rows property.

When the content exceeds the comment area, a vertical scrollbar appears. Enable the autoGrow property if you want the comment area to automatically expand or shrink to accommodate the content and thus remove the scrollbar. You can also enable SurveyModel's autoGrowComment property to activate the same feature for all comment areas in a survey.

A Long Text question displays a resize handle that allows users to resize the comment area. If you want to hide the handle, disable the allowResize property in an individual Long Text question's configuration or the allowResizeComment in SurveyModel. The latter property hides the resize handle for all comment areas.

Limit the Number of Input Characters

A Long Text form field accepts an unlimited number of characters. If you want to set a limit, use the maxLength property. With this setting, the comment area displays a character count.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.