⬆️ ⬇️

[Ctrl + Enter] - shortcut for quick submission of forms to Drupal

How to simplify form submission in Drupal system?



The shortcut [Ctrl + Enter] is used on the F. Ripper site (you can check it in the link by the link).



You can send almost any form (be it a record editing form, a comment form, or a form of settings in the admin panel) without resorting to the mouse, without pressing the Start button itself, or its equivalent — just press [Ctrl + Enter] on any page of the site, and it reduces the burden on the user's hands.

')

How is this done?



Shortcut implemented using the module Drupal Keyboard Shortcut Utility . After installing and activating the module, create a new shortcut ( / node / add / shortcut ). Specify the desired key combination, in this case, we specify Ctrl in the “Meta Keys” field and RETURN in the “Key> Character Code” field).



Now, in the “Type of action or URL” field, select “ Call a JS Function ” and in the “Action to take” field, enter Javascript:



document.getElementById('edit-submit').click();



Screenshot of shortcut settings:



image



This is all that is needed - now on any page of the site, pressing Ctrl + Enter automatically calls this function.

Undoubtedly, the above solution is primitive and there are plenty of ways to improve it - after all, everything is possible with Drupal and imagination.

Source: https://habr.com/ru/post/98156/



All Articles