+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 (220 points)

1 Answer

+1 vote

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 (1.4k points)
Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
111 questions
118 answers
51 comments
310 users