diff --git a/hide_submit.module b/hide_submit.module
index f772c9f..4db0f3d 100644
--- a/hide_submit.module
+++ b/hide_submit.module
@@ -9,32 +9,63 @@
  */
 
 /**
- * Implements hook_init().
+ * Adds the settings.
+ *
+ * @return
+ *   TRUE if hide_submit is active.
  */
-function hide_submit_init() {
-  $hide_submit_settings = array('hide_submit' => array(
-    'hide_submit_status' => variable_get('hide_submit_status', TRUE),
-    'hide_submit_method' => variable_get('hide_submit_method', 'disable'),
-    'hide_submit_css' => variable_get('hide_submit_css', 'hide-submit-disable'),
-    'hide_submit_abtext' => t(variable_get('hide_submit_abtext', '')),
-    'hide_submit_atext' => t(variable_get('hide_submit_atext', '')),
-    'hide_submit_hide_css' => variable_get('hide_submit_hide_css', 'hide-submit-processing'),
-    'hide_submit_hide_text' => t(variable_get('hide_submit_hide_text', 'Processing...')),
-    'hide_submit_hide_fx' => t(variable_get('hide_submit_hide_fx', FALSE)),
-    'hide_submit_reset_time' => (int)variable_get('hide_submit_reset_time', 5000),
-  ));
-
-  // Allow other modules to modify this behavior.
-  $altered_hide_submit_settings = module_invoke_all('hide_submit_alter', $hide_submit_settings);
-  if (!empty($altered_hide_submit_settings)) {
-    // Ovewrwrite the settings with altered values.
-    $hide_submit_settings = $altered_hide_submit_settings+$hide_submit_settings;
+function hide_submit_add_settings() {
+  static $hide_submit_settings;
+  if (!$hide_submit_settings) {
+    $hide_submit_settings = array('hide_submit' => array(
+      'hide_submit_status' => variable_get('hide_submit_status', TRUE),
+      'hide_submit_method' => variable_get('hide_submit_method', 'disable'),
+      'hide_submit_css' => variable_get('hide_submit_css', 'hide-submit-disable'),
+      'hide_submit_abtext' => t(variable_get('hide_submit_abtext', '')),
+      'hide_submit_atext' => t(variable_get('hide_submit_atext', '')),
+      'hide_submit_hide_css' => variable_get('hide_submit_hide_css', 'hide-submit-processing'),
+      'hide_submit_hide_text' => t(variable_get('hide_submit_hide_text', 'Processing...')),
+      'hide_submit_hide_fx' => t(variable_get('hide_submit_hide_fx', FALSE)),
+      'hide_submit_reset_time' => (int)variable_get('hide_submit_reset_time', 5000),
+    ));
+
+    // Allow other modules to modify this behavior.
+    $altered_hide_submit_settings = module_invoke_all('hide_submit_alter', $hide_submit_settings);
+    if (!empty($altered_hide_submit_settings)) {
+      // Overwrite the settings with altered values.
+      $hide_submit_settings = $altered_hide_submit_settings+$hide_submit_settings;
+    }
+
+    // Add settings.
+    if ($hide_submit_settings['hide_submit']['hide_submit_status']) {
+      drupal_add_js($hide_submit_settings, 'setting');
+    }
   }
+  return $hide_submit_settings['hide_submit']['hide_submit_status'];
+}
+
+/**
+ * Implements hook_form_alter().
+ */
+function hide_submit_form_alter(&$form, &$form_state, $form_id) {
+  if (hide_submit_add_settings()) {
+    // Add javascript.
+    if (!isset($form['#attached']['js'])) {
+      $form['#attached']['js'] = array();
+    }
+    $form['#attached']['js'][drupal_get_path('module', 'hide_submit') . '/hide_submit.js'] = array(
+      'type' => 'file',
+      'weight' => 10,
+    );
 
-  if ($hide_submit_settings['hide_submit']['hide_submit_status']) {
-    drupal_add_js($hide_submit_settings, 'setting');
-    drupal_add_js(drupal_get_path('module', 'hide_submit') . '/hide_submit.js', array('weight' => 10));
-    drupal_add_css(drupal_get_path('module', 'hide_submit') . '/hide_submit.css');
+    // Add css.
+    if (!isset($form['#attached']['css'])) {
+      $form['#attached']['css'] = array();
+    }
+    $form['#attached']['css'][drupal_get_path('module', 'hide_submit') . '/hide_submit.css'] = array(
+      'type' => 'file',
+      'weight' => 10,
+    );
   }
 }
 
