+1 vote

I have a question that allows users to select answers populated from a previous question.
I’d like the user to be able to add an answer if the selection of answers is not sufficient.

For instance:

Which color is your favorite:
Green
Blue
Yellow
__Add a color_

Also:
Is it possible to select multiple answers?

by (350 points)

1 Answer

+2 votes

Hi! Try this code:

*question: What are your favorite colors?
	*type: checkbox
	Red
	Blue
	Orange
	Other
	*save: favColors
	
*if: "Other" in favColors

	*label: askOtherColor
	*question: What other colors?
		*tip: Enter one color per line
		*multiple
		*save: addFavColors
		
	--add addFavColors to the list of favorite colors
	>>favColors.combine(addFavColors)
	
	--remove "Other" from list of favorite colors
	>>favColors.erase("Other")
	
This is your list of favorite colors: {favColors}
by (3.6k points)
Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
134 questions
144 answers
55 comments
40 users