User:Dragoniez/SuppressEnterInForm

SuppressEnterInForm is a script that prevents form submission when you accidentally hit Enter in a textbox.

It works for textboxes like:

  • Summary box on an edit or preview page
  • Reason box for page move, block, delete, revision delete....
  • In fact any textbox in a form that sends a POST request on submission

You can still use Enter on forms like:

Installation

edit

Add the following to Special:MyPage/global.js for global use, or to Special:MyPage/common.js for use on meta, or to your common.js on the wiki(s) on which you want to use the script. (source code)

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/SuppressEnterInForm.js&action=raw&ctype=text/javascript');