This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:create:inputs-single [22.06.2019 15:29] – Update admin | en:create:inputs-single [25.04.2025 19:39] (current) – 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 | + | 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. SoSci Survey |
{{: | {{: | ||
Line 12: | Line 12: | ||
Actually, we merge different questions here. The example above shows a scale (question 1), one item from a text input question (question 2) and a dropdown selection (question 3). | Actually, we merge different questions here. The example above shows a scale (question 1), one item from a text input question (question 2) and a dropdown selection (question 3). | ||
- | |||
- | 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 '' | 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 '' | ||
Line 66: | Line 64: | ||
<code javascript> | <code javascript> | ||
<script type=" | <script type=" | ||
- | QuestionSelect.LinkSelect2Text(" | + | S2Selection.linkOptionToInput(" |
</ | </ | ||
</ | </ | ||
- | 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 first parameter in the function `S2Selection.linkOptionToInput()` 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: | If more than one open-ended inputs are used, you can simply call the function several times: | ||
Line 78: | Line 74: | ||
<code javascript> | <code javascript> | ||
<script type=" | <script type=" | ||
- | new S2Selection.LinkSelect2Text(" | + | S2Selection.linkOptionToInput(" |
- | new S2Selection.LinkSelect2Text(" | + | S2Selection.linkOptionToInput(" |
- | new S2Selection.LinkSelect2Text(" | + | S2Selection.linkOptionToInput(" |
</ | </ | ||
</ | </ | ||
Line 89: | Line 85: | ||
You have a dropdown within a selection (placed via placeholder) and the respective selection option shall automatically be selected when the dropdown is used? | You have a dropdown within a selection (placed via placeholder) and the respective selection option shall automatically be selected when the dropdown is used? | ||
- | This is accomplished by the JavaScript function '' | + | This is accomplished by the JavaScript function '' |
<code javascript> | <code javascript> | ||
<script type=" | <script type=" | ||
- | new S2Selection.linkOptionToInput(" | + | S2Selection.linkOptionToInput(" |
</ | </ | ||
</ | </ |