This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:inputs-single [25.06.2013 17:24] – created janisaltherr | en:create:inputs-single [11.12.2017 21:39] – Added JavaScript info 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 the PHP-function '' | + | 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 the PHP-function '' |
{{: | {{: | ||
Line 49: | Line 49: | ||
The other input field is a dropdown selection. We don't just need one item but the whole question " | The other input field is a dropdown selection. We don't just need one item but the whole question " | ||
- | As the preview still won't show much, you need to use php when assembling the questionnaire. When creating the questionnaire, | + | As the preview still won't show much, you need to use php when assembling the questionnaire. When creating the questionnaire, |
<code php> | <code php> | ||
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(" | ||
+ | </ | ||
+ | </ |