This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:inputs-single [18.12.2014 20:51] – admin | en:create:inputs-single [21.06.2019 19:40] – Partial Update admin | ||
---|---|---|---|
Line 5: | Line 5: | ||
**Important: | **Important: | ||
- | How to achieve a similar output with scales and other question types and how to provide a dropdown selection inside another question is described here. SoSciSurvey provides | + | How to achieve a similar output with scales and other question types and how to provide a dropdown selection inside another question is described here. SoSciSurvey provides |
{{: | {{: | ||
Line 14: | Line 14: | ||
Technically, | Technically, | ||
+ | |||
+ | First, the inputs to be used have to be created in the **list of questions**. That means you create a new question, for example a text input question. Second, a placeholder is created, consisting of '' | ||
**Tip:** Not every question type is available as independent input fields. | **Tip:** Not every question type is available as independent input fields. | ||
Line 26: | Line 28: | ||
Create a new section with the //ID// " | Create a new section with the //ID// " | ||
- | Create the superior | + | Create the question ZE01 with //type// "text input". In this question, an item is added automatically, |
- | + | ||
- | {{: | + | |
- | + | ||
- | Create another question ZE02 with the //type// "Text input" | + | |
- | There is no need to add neither a question nor a "text in front of the input field" although the "text in front" | + | |
{{: | {{: | ||
- | Create | + | Create |
{{: | {{: | ||
+ | |||
+ | FIXME | ||
Now we have to add placeholders into the superior question ZE01 (For more options, see [[placeholders|placeholders in questions and items]]. To do so, we add two items with the text " | Now we have to add placeholders into the superior question ZE01 (For more options, see [[placeholders|placeholders in questions and items]]. To do so, we add two items with the text " | ||
+ | |||
The first additional input field derives from item 01 of the question ZE02. The ID of this item is ZE02_01. Use this ID as a placeholder and add percent symbols to it: '' | The first additional input field derives from item 01 of the question ZE02. The ID of this item is ZE02_01. Use this ID as a placeholder and add percent symbols to it: '' | ||
Therefore add an item to the superior question containing the //item text//: " | Therefore add an item to the superior question containing the //item text//: " | ||
Line 62: | Line 62: | ||
{{: | {{: | ||
+ | |||
+ | |||
+ | ====== Optimization ======= | ||
+ | |||
+ | An open-ended [[selection-textinput|text input in a normal selection question]] automatically selects the appropriate option when the respondent writes something into the text field. When text inputs are placed using `prepare_input()`, | ||
+ | |||
+ | |||
+ | ===== Extended Selection and Text ==== | ||
+ | |||
+ | For example, if a question of the type " | ||
+ | |||
+ | <code javascript> | ||
+ | <script type=" | ||
+ | QuestionSelect.LinkSelect2Text(" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The first parameter in the function `QuestionSelect.LinkSelect2Text()` specifies the HTML ID of the radio button or checkbox, in the example the option with the code 12 in question AU01 (an extended selection that allows multiple choice selection). The second parameter is the HTML identifier of the corresponding text input (here the first input in question TE01). | ||
+ | |||
+ | The function `prepare_input ()` (in the PHP code at the top of the page) would have been used in this example for the identifier '' | ||
+ | |||
+ | If more than one open-ended inputs are used, you can simply call the function several times: | ||
+ | |||
+ | <code javascript> | ||
+ | <script type=" | ||
+ | QuestionSelect.LinkSelect2Text(" | ||
+ | QuestionSelect.LinkSelect2Text(" | ||
+ | QuestionSelect.LinkSelect2Text(" | ||
+ | </ | ||
+ | </ |