Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:dynamic [28.11.2014 13:14] – [Example 3: Alternative Questions] alexander.ritteren:create:dynamic [04.01.2015 17:24] – [JavaScript Code] alexander.ritter
Line 19: Line 19:
 **Note:** The JavaScript code should be designed to hide unnecessary content; not show necessary content. This has the advantage that participants with JavaScript deactivated can still answer the question as the question was not hidden.  **Note:** The JavaScript code should be designed to hide unnecessary content; not show necessary content. This has the advantage that participants with JavaScript deactivated can still answer the question as the question was not hidden. 
  
-**Note:** Screenreaders, which enable people with visual impairments to take part in your survey, do not always cope with dynamic content. Using this function can reduce the accessibility of your questionnaire.+**Note:** Screenreaders, which enable people with visual impairments to take part in your survey, do not always cope with dynamic content. Using this feature can reduce the accessibility of your questionnaire.
  
 **Tip:** If the participant sees that one of the selection options involves extra work, then this could influence his responsiveness. Here, a classic [[filters|Filter]] asking the second question on the following page could make more sense. **Tip:** If the participant sees that one of the selection options involves extra work, then this could influence his responsiveness. Here, a classic [[filters|Filter]] asking the second question on the following page could make more sense.
Line 105: Line 105:
 ==== Questionnaire Page ==== ==== Questionnaire Page ====
  
-Perhaps you cannot work with the standard HTML IDs available -- because you integrate a question multiple times on the page for some of them and display different items for each one. In this instance, the questions to be shown are enclosed with ''DIV'' elements. As a result, the questionnaire page will be rather long. For the first question, 4 pixels is set as  the //Spacing to the next question// ({{:button.settings.png?nolink|Display Settings in the Questionnaire}}).+Perhaps you cannot work with the standard HTML IDs available -- because you integrate a question multiple times on the page for some of them and display different items for each one. In this instance, the questions to be shown are enclosed with ''DIV'' elements. The questionnaire page will be rather long as result of this. For the first question, 4 pixels is set as  the //Spacing to the next question// ({{:button.settings.png?nolink|Display Settings in the Questionnaire}}).
  
  
Line 120: Line 120:
  
 function blender() { function blender() {
-  // the value whose value corresponds to the answer code in the Variables Overview+  // The value whose value corresponds to the answer code in the Variables Overview
   var selected = dropdown.value;   var selected = dropdown.value;
-  // however, the value is text rather than a number+  // However, the value is text rather than a number
   selected = parseInt(selection);   selected = parseInt(selection);
  
-  // this check is repeated for each question to be shown+  // This check is repeated for each question to be shown
   var question1 = document.getElementById("blockAB06");   var question1 = document.getElementById("blockAB06");
   if (selected == 1) {   if (selected == 1) {
Line 150: Line 150:
 } }
  
-// the function should be called up directly first +// The function should be called up first directly 
-// all drop-downs have to be hidden+// All drop-downs have to be hidden
 blender(); blender();
  
-// now the function still has to be linked with the change event +// Now the function still has to be linked with the change event 
 // of the first drop-down // of the first drop-down
 SoSciTools.attachEvent(dropdown, "change", blender); SoSciTools.attachEvent(dropdown, "change", blender);
en/create/dynamic.txt · Last modified: 07.12.2023 20:51 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki