Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Prefill survey using previous responses

  • leadmeout
  • leadmeout's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 weeks ago #181439 by leadmeout
Prefill survey using previous responses was created by leadmeout
Hello,

we have a pro license for the offline app and would like to use the "prefill" option for several of our surveys.

However, I keep encountering JS errors when adding the source code to the question. I am currently testing one question in one survey.

Could someone please tell me if the code is correct?

I copied it from the FAQ article: www.offlinesurveys.com/ufaqs/prefill-sur...ng-previous-response

Code:
<p>What is your name?</p>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
      var questionObj = $('#question' + {QID});
      questionObj.addClass(“prefill”);
    });
</script>

Do I have to make changes to the code based on my survey?

Removing the script results in no errors when syncing the survey on the app.

Thank you in advance for your assistance.

Cheers.
The topic has been locked.
More
5 years 2 weeks ago #181445 by lfanfoni
Replied by lfanfoni on topic Prefill survey using previous responses
In LimeSurvey 3.X I think isn't necessary to add JS to that question, but just define in the advanced options of that question the CSS class = prefill
In my free offline this works well

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The following user(s) said Thank You: aaskoura
The topic has been locked.
  • leadmeout
  • leadmeout's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 weeks ago #181450 by leadmeout
Replied by leadmeout on topic Prefill survey using previous responses
This worked for me. Thank you so much!! :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose