Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: custom functions

custom functions 5 years 10 months ago #48239

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
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)limesurvey.org'"
The administrator has disabled public write access.

custom functions 5 years 9 months ago #49898

  • sociolog
  • sociolog's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
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: 5 years 9 months ago by sociolog. Reason: found out
The administrator has disabled public write access.

custom functions 5 years 9 months ago #50123

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
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)limesurvey.org'"
The administrator has disabled public write access.

custom functions 5 years 9 months ago #50151

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

custom functions 5 years 9 months ago #50193

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.201 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form