diff --git a/app/assets/javascripts/validation.js b/app/assets/javascripts/validation.js index b815e265..b0769adf 100644 --- a/app/assets/javascripts/validation.js +++ b/app/assets/javascripts/validation.js @@ -1,5 +1,5 @@ $(document).on('turbolinks:load', function() { - $(document).on('keypress', ':input:not(textarea):not([type=submit])', function(e) { + $(document).on('keypress', '.post :input:not(textarea):not([type=submit])', function(e) { if (e.keyCode == 13) { e.preventDefault(); e.stopPropagation(); diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 770dd1d4..af641f3f 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -21,7 +21,7 @@ = render 'layouts/help', help: CommonMarker.render_doc(pre).to_html = form_tag url, method: method, - class: "form #{@invalid ? 'was-validated' : ''}", + class: "form post #{@invalid ? 'was-validated' : ''}", novalidate: true, multipart: true do