1. Home
  2. Survey
  3. Build Survey
  4. Question types
  5. Value assignment (professional user)
  6. Enable and disable text fields when selecting answer in previous question

Enable and disable text fields when selecting answer in previous question

Suppose you have included a single response question in your survey. However, when selecting a particular answer from this question, you want some text fields in a subsequent question to be greyed out, so that a participant cannot specify anything in these text fields. In order to arrange this, you can adhere to the following procedure:

First, for example, you include a single response question (q1 in this example) in the survey from which a participant can select a colour. Upon selecting the colour Yellow, you want the first column in the next matrix question to be completely greyed out. This implies that a participant cannot enter text at any row in column 1.

Prior to the single response question, you should then include a value assignment in the survey.

  • At the box Is equal to the following term: you record three lines with the setSurveyFieldsEditable([VariableName]) function which will override the read-only mode. This implies that a participant is initially allowed to enter text at, say, all rows in column 1; there is yet no restriction on the colour Yellow.
  • At the Execute setting, you select the option Anytime (immediately after every change to an involved variable).

Between the first (here: single response question) and second (here: matrix question) question, you then include a second value assignment including a filter.

  • At the box Is equal to the following term: you record three lines with the setSurveyFieldsReadOnly([VariableName]) function which will set the read-only mode for the indicated text fields. In this example, these are the text fields:
    – q2_1_1 > row 1, column 1 of question q2
    – q2_2_1 > row 2, column 1 of question q2
    – q2_3_1 > row 3, column 1 of question q2
    Now, for a participant, depending on the value (= colour) defined at the filter, these text fields will be greyed out so that this participant will not be able to enter text in them, if he/she has selected the colour stipulated in the filter at the first question.
  • At the Execute setting, you select the option Anytime (immediately after every change to an involved variable).

After you have clicked on the Add filter button for this value assignment, a window appears allowing you to record the following data:

  • if – Question – q1 (description of the question) – 3 Yellow – selected

In order to record the filter, you must click the green Save changes button.

Updated on August 28, 2023

Was this article helpful?

Related Articles

Need Support?
Please login to your Survalyzer account and use the "Create Support Request" form.
Login to Survalyzer