--- compact_forms.orig.js	2009-08-06 15:27:22.000000000 -0500
+++ compact_forms.js	2010-04-08 11:17:37.000000000 -0500
@@ -13,43 +13,42 @@ $.fn.compactForm = function (stars, colo
     $(this).addClass('compact-form').find('label').each(function () {
       var context = this.form;
       var $label = $(this);
-      var $field = $('#' + $label.attr('for'), context);
-      if (!$field.is('input:text,input:password,textarea')) {
+      var $checkme = $label.attr('for');
+      if (($checkme == null) || (typeof($checkme)=="undefined") || ($checkme == '')){
         return;
-      }
-
-      if ($field.val() != '') {
-        $label.fadeOut(1);
-      }
-
-      $label.parent().addClass('compact-form-wrapper');
-      $label.addClass('compact-form-label');
-      $field.addClass('compact-form-field');
-
-      if (stars === 0) {
-        $label.find('.form-required').hide();
-      }
-      else if (stars === 2) {
-        $label.find('.form-required').insertAfter($field).prepend('&nbsp;');
-      }
-
-      if (colons === 0) {
-        var lbl = $label.html();
-        lbl = lbl.replace(/:/,' ');
-        $label.html(lbl);
-      }
-
-      $field.focus(function () {
-        if($(this).val() === '') {
-          $label.fadeOut('fast');
+      } else {        
+        var $field = $('#' + $label.attr('for'), context);
+        if (!$field.is('input:text,input:password,textarea')) {
+          return;
         }
-      });
-
-      $field.blur(function () {
-        if($(this).val() === '') {
-          $label.fadeIn('slow');
+        if ($field.val() != '') {
+          $label.fadeOut(1);
+        }
+        $label.parent().addClass('compact-form-wrapper');
+        $label.addClass('compact-form-label');
+        $field.addClass('compact-form-field');
+        if (stars === 0) {
+          $label.find('.form-required').hide();
         }
-      });
+        else if (stars === 2) {
+          $label.find('.form-required').insertAfter($field).prepend('&nbsp;');
+        }
+        if (colons === 0) {
+          var lbl = $label.html();
+          lbl = lbl.replace(/:/,' ');
+          $label.html(lbl);
+        }
+        $field.focus(function () {
+          if($(this).val() === '') {
+            $label.fadeOut('fast');
+          }
+        });
+        $field.blur(function () {
+          if($(this).val() === '') {
+            $label.fadeIn('slow');
+          }
+        });
+      }
     });
   });
 };
