Commit 3dd184c94e5e0f4181271addb8c8287c9c460c1a

Authored by Miguel Barão
1 parent bff14879
Exists in master and in 1 other branch dev

- disabled enter submit (again)

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
aprendizations/static/js/topic.js
... ... @@ -67,13 +67,13 @@ function new_question(type, question, tries, progress) {
67 67 });
68 68 }
69 69  
70   - // prevent enter submit.
71   - //input:text, input:radio, input:checkbox
72   - $("body").keyup(function (e) {
73   - if (e.keyCode == 13 && e.shiftKey) {
74   - $("#submit").click();
  70 + // disable enter in some question types (prevent submission on enter)
  71 + $("input:text, input:radio, input:checkbox").keydown(function (e) {
  72 + if (e.keyCode == 13 || e.keyCode == 169) {
  73 + e.preventDefault();
75 74 return false;
76   - }});
  75 + }
  76 + });
77 77 }
78 78  
79 79  
... ...