- Posts: 13648
- Thank you received: 2491
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Tab and Enter keys
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
7 years 9 months ago #139623
by DenisChenu
Put this at top of your template.js file
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Tab and Enter keys
It's not an answer .....adridg wrote:
DenisChenu wrote: Or just remove the line 80 to 84
Didn´t work for FireFox and Chrome.
Put this at top of your template.js file
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: adridg, ConradNg
The topic has been locked.
- Diegoteca
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
4 years 6 months ago - 4 years 6 months ago #190018
by Diegoteca
Hello! I am working with 3.17.9 + 190731 and with the Bootswatch theme.
The code above works great for me. I copied this in "Files.js" of advanced options.
But I have a problem with the numerical questions when the following questions (also numerical) have to be hidden / shown according to conditional fork. More precisely, with some numbers when I press "enter" it goes right to the immediate next question. But for the options that I need to "skip" two or more questions these are actually "hidden" and the correct question appears below but the cursor remains on the initial question. One fact: if "tab" is pressed, the cursor effectively points to the desired question.
Is it as if the code above would be useful for "movenextbtn" and maybe when there are jumps, another command must be added?
First, I thought the problem was my misuse of the configuration condition, but the logical file shows no problem.
In the example that I attach if you put a number other than 1 in the first question and press "enter" you should skip to the last question. The other questions are effectively hidden but the cursor only jumps with the "Tab" key.
Thanks in advance,
Diego
Replied by Diegoteca on topic Tab and Enter keys
Bigred01 wrote: To trigger the next button, try this.
Code:$(document).ready(function() { $('input').on('keydown keypress', function(e) { if(e.keyCode === 13) { e.preventDefault(); $('#movenextbtn').click(); } }); });
Hello! I am working with 3.17.9 + 190731 and with the Bootswatch theme.
The code above works great for me. I copied this in "Files.js" of advanced options.
But I have a problem with the numerical questions when the following questions (also numerical) have to be hidden / shown according to conditional fork. More precisely, with some numbers when I press "enter" it goes right to the immediate next question. But for the options that I need to "skip" two or more questions these are actually "hidden" and the correct question appears below but the cursor remains on the initial question. One fact: if "tab" is pressed, the cursor effectively points to the desired question.
Is it as if the code above would be useful for "movenextbtn" and maybe when there are jumps, another command must be added?
First, I thought the problem was my misuse of the configuration condition, but the logical file shows no problem.
In the example that I attach if you put a number other than 1 in the first question and press "enter" you should skip to the last question. The other questions are effectively hidden but the cursor only jumps with the "Tab" key.
Thanks in advance,
Diego
Attachments:
Last edit: 4 years 6 months ago by Diegoteca.
The topic has been locked.