Check out the LimeSurvey source code on GitHub!

custom functions

More
6 years 5 months ago #48239 by Mazi
Javascruipt always has to be added in source code mode: docs.limesurvey.org/tiki-index.php?page=...#X._Source_code_mode :


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 4 months ago - 6 years 4 months ago #49898 by sociolog
OK. Say I have a question called "What is your age", with the code a1 and the ID 11700, using the default template. And I want to hide the whole row with the question name, so that only the answer is shown, but only for question a1. I activated javascript. What should I put in the source code of the question? I tried this code, but it didn't work.

<script>
jQuery(document).ready(
function(){
document.getElementById("questiontext11700").style.display='none';
}
);
</script>

I probably don't know how to call the question by id. Can you help me, please?

EDIT: I got it to work! I just used this script, putting the question ID (11700 after div#question) and it seems to work fine (hope it works in Internet Explorer too).

<script>
jQuery(document).ready(
function(){
$('div#question11700 td.questiontext').parent().hide();
}
);
</script>
Last Edit: 6 years 4 months ago by sociolog. Reason: found out

Please Log in to join the conversation.

More
6 years 4 months ago #50123 by Mazi
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 4 months ago #50151 by sociolog
Thank you. I have already made a donation, and if I can persuade my current team leader, I will make another one next month.
Regards,
Vlad

Please Log in to join the conversation.

More
6 years 4 months ago #50193 by Mazi
Thanks!


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

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