Hey everyone,
I am trying to assign a value to an internal variable (SD20_01, description: pageID, Text/ string) using java script.
However, I can currently only assign a value by entering one in debug mode, which will then show up in my collected data. I would like to assign a value independent of user input every time the page is opened in the questionnaire. Ultimately, I would like to store a unique id from the web page that is embedded via iframe in the internal sosci variable.
For now my goal is to just assign any value, but my java script does not seem to work. It's based on this page of the user manual: https://www.soscisurvey.de/help/doku.php/en:create:questions:internal and looks like this:
<script type="text/javascript">
<!--
var input = document.getElementById("SD20_01");
input.value = "wow this works";
}
// -->
</script>
I will attach an image of the current status.
I would really appreaciate any ideas, I feel like I might be missing something obvious.
Kind regards,
Anna