Use an answer to prefill another answer

Más
6 años 11 meses antes #83167 por 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'

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

LimeSurvey Partners
Más
6 años 11 meses antes - 6 años 11 meses antes #83174 por 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 .
Última Edición: 6 años 11 meses antes por TMSWhite.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión