This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
en:create:dynamic [18.12.2014 15:10] – [The Basics] alexander.ritter | en:create:dynamic [04.01.2015 17:24] – [JavaScript Code] alexander.ritter | ||
---|---|---|---|
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(" | var question1 = document.getElementById(" | ||
if (selected == 1) { | if (selected == 1) { | ||
Line 150: | Line 150: | ||
} | } | ||
- | // the function should be called up directly | + | // 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, | SoSciTools.attachEvent(dropdown, |