Text Boxes Where What Happens Depends on the Answer🔗

Sometimes you might have a guess as to what a user will type in a text box. If so, you can choose to tailor what happens next in your program based on what they put in the text box.

*question: What is the biggest city in New York?
	*type: text
	New York
		Brilliant!
	ny
		Excellent!
	Jupiter
		You're an idiot!
	*other
		Sorry, you are incorrect.

In the above example, it's important to write *type: text so that the user will see a text box in which to write their answer, rather than a multiple choice question. In this example, users who type "New York" will then see the text "Brilliant," whereas users who type "NY" will then see "Excellent!" and so on. Users who write something "other" than what the programmer expected will receive the message "Sorry, you are incorrect." Without adding the *other keyword, users who wrote something other than one of the selected answers would simply see the next screen, without a tailored response.

Note that the options you provide are not case sensitive, so if the user put "NeW YoRk" in the text box, they would still see the response "Brilliant!", just like they'd get if they had typed "New York". Also, the ordering of your keywords doesn't matter here. You could have put the *other keyword and its indented response above Jupiter and its indented response. Either way, *question would function in exactly the same way.


Next: