[Solved] Trouble using your code to disable the enter key during the survey


I am trying to include this code in the survey theme for the purpose of disabling the return key.

I got the code from this website but can’t get it to work. Full disclaimer I am not a coder and have no idea what the below code does. So I  may have missed a syntax , although I checked it a few times.

   $(“form :input:not(textarea)”).on(“keypress”, function(e) {
      return e.keyCode != 13;
$(“form :input:not(textarea)”).on(“keydown”, function(e) {
   return e.keyCode != 13;


Any help you can give me would be appreciated.

amy_aha answered

    Best answer


    Hi Thomas,

    In that script it looks like it is only disabling the enter key if they are in a text area.

    I tested this on one page of my survey and it seemed to work for me. Give it a try.

    You will have to add this Action to every page you would like for this to take place.

    Create a Javascript – Action with the following code in it-

    $(‘html’).bind(‘keypress’, function(e)
    if(e.keyCode == 13)
    return false;

    Jacob Hayslett answered

      I’m having trouble with both of these codes. Enter still advances the survey.

      amy_aha commented
        • Joshua in support helped me with this yesterday. Turns out you need to have the desktop interaction mode (in Style) set to standard. If it’s set as one at a time the javascript will not work.



        Question stats

        • Active
        • Views7239 times
        • Answers2 answers
        • Followers0 followers