Use an answer to prefill another answer

Mehr
6 Jahre 11 Monate her #83167 von amritdeep
In limesurvey workaround i have found the code for
"Use an answer to prefill another answer"

<script>
<!--
function Custom_On_Load(){
document.getElementById('answer1000X11X30').value='{INSERTANS:1000X10X20}';
document.getElementById('answer1000X11X31').value='{INSERTANS:1000X10X21}';
}
-->
</script>



Please tell me where i have to copy this code so that answer of '1000X10X20' copy to 'answer1000X11X30'

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
6 Jahre 11 Monate her - 6 Jahre 11 Monate her #83174 von TMSWhite
You can actually use Expression Manager to use one answer to set the value of another question, even if the other question is in another group (as is the case in your example).

Say your questions are 'a1' (1000X10X20), 'a2' (1000X10X21), 'b1' (1000X11X30), and 'b2' (1000X11X31), you would assign the values this way:
{b1=a1, b2=a2, ''}

This code could be put in a question or help text. Since it uses the comma operator, it returns the final value (''), so nothing will be displayed. You can also call this from either group 10 or group 11, although calling from group 11 will avoid having Expression Manager warn you of potential errors. Lastly, you don't need to put this within a <script>.

Some relevant documentation can be found here .
Letzte Änderung: 6 Jahre 11 Monate her von TMSWhite.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha