Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: use answer previous question in answer next question

use answer previous question in answer next question 5 years 7 months ago #59407

  • ericbont
  • ericbont's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 2
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.
The administrator has disabled public write access.

use answer previous question in answer next question 5 years 7 months ago #59413

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • Karma: 390
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 (use private message).
The administrator has disabled public write access.

use answer previous question in answer next question 5 years 7 months ago #59705

  • ericbont
  • ericbont's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 2
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
The administrator has disabled public write access.

use answer previous question in answer next question 5 years 7 months ago #59706

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • Karma: 390
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 (use private message).
Last Edit: 5 years 7 months ago by DenisChenu.
The administrator has disabled public write access.
Time to create page: 0.215 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form