This module allows you to use Ctrl+S or Cmd+S to save your forms.

The module deals with the following issues:

  • Choosing the correct button to execute the click on.
  • Capturing focus on the form and executing the button on the focused form.
  • Capturing the Enter key on text fields and submitting the relevant button rather than just submitting the form without a button.

It is important that the button is clicked rather than just submitting the form as this ensures the 'triggered_element' variable is set correctly and the correct submit code is executed where multiple buttons are used.

To install simply enable the module.

To set a button as the default button, add '#default_button' => TRUE to your button declaration in the form.

For example:

$form['my_button'] = array(
  '#type' => 'submit',
  '#value' => t('My Button'),
  '#default_button' => TRUE,
);

A massive thank you must go to johnv who helped to test this module thoroughly!

Downloads

Recommended releases

Version Downloads Date Links
7.x-1.0 tar.gz (7.75 KB) | zip (8.62 KB) 2011-May-12 Notes

Development releases

Version Downloads Date Links
7.x-1.x-dev tar.gz (7.75 KB) | zip (8.62 KB) 2011-May-12 Notes

Project Information


Maintainers for Form Save

  • timhilliard - 8 commits
    last: 1 year ago, first: 1 year ago

Issues for Form Save

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here