diff --git a/misc/form.js b/misc/form.js
index 259b84e..a249a34 100644
--- a/misc/form.js
+++ b/misc/form.js
@@ -62,16 +62,19 @@ Drupal.behaviors.formUpdated = {
  */
 Drupal.behaviors.fillUserInfoFromCookie = {
   attach: function (context, settings) {
-    $('form.user-info-from-cookie').once('user-info-from-cookie', function () {
-      var formContext = this;
-      $.each(['name', 'mail', 'homepage'], function () {
-        var $element = $('[name=' + this + ']', formContext);
-        var cookie = $.cookie('Drupal.visitor.' + this);
-        if ($element.length && cookie) {
-          $element.val(cookie);
-        }
+    var $cookieForm = $('form.user-info-from-cookie');
+    if ($cookieForm.length > 0) {
+      $cookieForm.once('user-info-from-cookie', function () {
+        var formContext = this;
+        $.each(['name', 'mail', 'homepage'], function () {
+          var $element = $('[name=' + this + ']', formContext);
+          var cookie = $.cookie('Drupal.visitor.' + this);
+          if ($element.length && cookie) {
+            $element.val(cookie);
+          }
+        });
       });
-    });
+    }
   }
 };
 
