- Posts: 18
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
printFunction ( {Q1.question}, {Q5.question}, {Q7.question} );
printFunction2 ( {SID} );
Is it possible to access LimeSurvey Expressions via JavaScript? If so, how?
var myVar = '{Qcode.NAOK}';
<div id="myVar">{Qcode.NAOK}</div> <script>var myVar = $('#myVar').text()</script>
DenisChenu wrote: Your first question are unrelated to Expression and JS, no ?
You can give the print answer url BEFORE survey is submitted
I use <a href="/index.php?r=printanswers/view&surveyid={SID}" target="_blank">Print your answers</a>
But you can force PDF too
<a href="/index.php?r=printanswers/view&surveyid={SID}&pdf=1">Export your answers as PDF</a>
DenisChenu wrote:
Is it possible to access LimeSurvey Expressions via JavaScript? If so, how?
Yes : for variable before the current one
Code:var myVar = '{Qcode.NAOK}';
If inside the same mageCode:<div id="myVar">{Qcode.NAOK}</div> <script>var myVar = $('#myVar').text()</script>
umrosa wrote: I will edit my post.
Then : you create a plugin ? You use a plugin ?umrosa wrote: I want to create a pdf report that contains only some of the participant's answers. Also, I want to display text in the same design as within the survey.
So no, the "print answers" function is not what I'm looking for.
Expression is related to Survey, custom.js to a lot of survey …umrosa wrote: This only works for script that is on the page, but I think I pointed out that I'm looking for a way to access LS Expressions from a JS function in the custom.js file of the theme.
Report issue : community.limesurvey.org/bug-tracker/Is there a subforum for technical issues with the forum itself?
Then : you create a plugin ? You use a plugin ?
With pdfReport plugin : you can use the url before survey it send, and you can force a PDF to be done with reset=1 in url.
gitlab.com/SondagesPro/ExportAndStats/pd...r/pdfReport.php#L424
Expression is related to Survey, custom.js to a lot of survey …