Answer questions with keypress

More
4 weeks 2 days ago #216282 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

 

Please Log in to join the conversation.

More
4 weeks 1 day ago #216331 by Klabunde726
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.

Please Log in to join the conversation.

More
4 weeks 1 day ago #216345 by holch
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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now