Welcome to the LimeSurvey Community Forum

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

Answer questions with keypress

  • Klabunde726
  • Klabunde726's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #216282 by Klabunde726
Answer questions with keypress was created by Klabunde726
Hello !

Answering with keypress can be implemented to a older version of LimesSurvey.  Here the manual: 

manual.limesurvey.org/Workarounds:_Manip...uestions_by_keypress  

I wonder how it can be implemented after the change from template to themebased system, e.g. change from endpage.pstpl to endpage.twig. 

Is there a location to adequate add a JavaScript or Html? Is there a workaround for the latest version?


Best wishes!
Adrian

 
The topic has been locked.
  • Klabunde726
  • Klabunde726's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #216331 by Klabunde726
Replied by Klabunde726 on topic Answer questions with keypress
Design erweitern(fruity => erweitert_fruity)
Konfiguration > Erweitert: Designvorlagen
Öffnen Designvorlagen Editor
links unter Javascript-Dateien
=> custom.js

$(document).bind('keypress', function(e) {
var $activeElement = $(document.activeElement);
if (!$activeElement.is('input:text') && !$activeElement.is('textarea')) {
var ascii0 = "0".charCodeAt();
var ascii9 = "9".charCodeAt();
if (e.which >= ascii0 && e.which <= ascii9) {
$('input:radio').each(function() {
var v = $(this).val();
var n = (e.which == ascii0) ? 10 : e.which - ascii0;
if(v == n || v == 'A' + n) {
$(this).click();
}
});
}
}
});

Umfrage das Desgin "erweiter_fruity" zu ordnen.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216345 by holch
Replied by holch on topic Answer questions with keypress
Hmm, this has nothing to do with "ComfortUpdate" and the "solution" is in German, within the English forum.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose