Welcome, Guest
Username: Password: Remember me

TOPIC: use answer previous question in answer next question

use answer previous question in answer next question 3 years 6 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.

Re: use answer previous question in answer next question 3 years 6 months ago #59413

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
You can have a look at
docs.limesurvey.org/tiki-index.php?page=...nswer_default_value_

It's more simple with jquery :)
The administrator has disabled public write access.

Re: use answer previous question in answer next question 3 years 6 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.

Re: use answer previous question in answer next question 3 years 6 months ago #59706

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
The workarounf are not at top .

WIth jquery;
<script>
$(document).ready(function() {
  $('#answer36165X3X38').val('{INSERTANS:36165X4X37}');
});
</script>
Last Edit: 3 years 6 months ago by DenisChenu.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.109 seconds
Donation Image