Check out the LimeSurvey source code on GitHub!

use answer previous question in answer next question

More
5 years 10 months ago #59407 by ericbont
Is it possible to use the answers of a previous question in the answers of a next question.

For example when you have a question about the adress of a person and in a next question you want to know the adress of his collegea (which is presumed to be the same adress) is it possible to have the data from the first question filled in in the next question.

Thanks for your help.

Please Log in to join the conversation.

More
5 years 10 months ago #59413 by DenisChenu
You can have a look at
docs.limesurvey.org/tiki-index.php?page=...nswer_default_value_

It's more simple with jquery :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 10 months ago #59705 by ericbont
I tried to have the answer prefilled in the next question by using the code in the link you send me. Perhaps I made a mistake because nothing happened. I used the question type multiple short answers. I also tried the code in a free text question but also no succes.

This is the code I used

<script>
<!--
function Custom_On_Load(){
document.getElementById('answer36165X3X38').value='{INSERTANS:36165X4X37}';
}
-->
</script>Test2: Wat is uw naam

I have set the XSS filter to no.

Do you have suggestions, perhaps I did something wrong?

Thanks for your help.

Eric

Please Log in to join the conversation.

More
5 years 10 months ago - 5 years 10 months ago #59706 by DenisChenu
The workarounf are not at top .

WIth jquery;
<script>
$(document).ready(function() {
  $('#answer36165X3X38').val('{INSERTANS:36165X4X37}');
});
</script>

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 5 years 10 months ago by DenisChenu.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form