====== Suggesting Text Input ======

At first, "Suggesting Text Input" (aka "JavaScript lookup") looks like a normal text input question to the respondent. However, as soon as characters are entered into the input field, suitable options are suggested which can be selected with the keyboard (arrow keys) or by clicking it with the mouse.


{{:de:create:questions:scr.suggest.png?nolink|Suggesting Text Input}}

When an option is chosen or entered manually, the corresponding (numerical) code will be saved in the data record -- responses are therefore encoded directly. 


If the question allows options to be entered other than the ones predefined, the input is saved as text (in another variable) in the data record. 


===== Advantages and Disadvantages =====

Suggesting text input is particularly helpful if there are a great deal of answer options in a questions -- and other types of questions such as a dropdown or a visible selection are therefore too confusing. Furthermore, suggesting text input is a better choice if open answers are allowed in addition to the options given.  

However, a mandatory switch from mouse to keyboard operating is required to answer the question -- at the moment, a dropdown selection is simpler to answer in some cases on smartphones ([[:en:create:smartphones|Questionnaires for Smartphones]]).

In addition, the type of question -- in comparison to a normal [[select|selection]] -- is accompanied by somewhat more effort in the analysis. If a participant changes the preset answer or expands on it (e.g. "I do not have a cell phone because I do not need one", instead of the default "I do not have a cell phone"), the responses are no longer able to be automatically encoded.


===== Options =====

Options are defined together with an answer code and (optional) search term. Text and search terms can be separated with a tab or a semicolon ('';''). A space between the answer code and text will also suffice. 


  00 Text of option A
  01 Text of option B; search term B1; search term B2
  
Search terms are not visible to the participant, but are considered when displaying suitable options: for example, if "Germany" is also entered as the search term for "Deutschland", the "Deutschland" option will appear, even if the participant typed "ger". 

The following options allow 5 places to be selected. If the respondent enters a zip code, the corresponding place appears as suggested text input:


<code>
01 Augsburg; 86150; 86152; 86153; 86154; 86156; 86157; 86159; 86161; 86163; 86165; 86167; 86169; 86179; 86199
02 Bergen; 83346
03 Chiemsee; 83256
04 Darmstadt; 64283; 64285; 64287; 64289; 64291; 64293; 64295; 64297
05 Erding; 85435
</code>