Index: misc/ajax.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ajax.js,v
retrieving revision 1.3
diff -u -9 -p -r1.3 ajax.js
--- misc/ajax.js	2 Oct 2009 14:55:40 -0000	1.3
+++ misc/ajax.js	26 Oct 2009 21:17:24 -0000
@@ -144,38 +144,38 @@ Drupal.ajax = function (base, element, e
   $(this.element).bind(element_settings.event, function () {
     if (ajax.form) {
       // If setClick is set, we must set this to ensure that the button's
       // value is passed.
       if (ajax.setClick) {
         // Mark the clicked button. 'form.clk' is a special variable for
         // ajaxSubmit that tells the system which element got clicked to
         // trigger the submit. Without it there would be no 'op' or
         // equivalent.
-        ajax.form.clk = this.element;
+        ajax.form.clk = element;
       }
 
       ajax.form.ajaxSubmit(options);
     }
     else {
       $.ajax(options);
     }
 
     return false;
   });
 
   // If necessary, enable keyboard submission so that AJAX behaviors
   // can be triggered through keyboard input as well as e.g. a mousedown
   // action.
   if (element_settings.keypress) {
-    $(element_settings.element).keypress(function (event) {
+    $(this.element).keypress(function (event) {
       // Detect enter key.
       if (event.keyCode == 13) {
-        $(element_settings.element).trigger(element_settings.event);
+        $(element).trigger(element_settings.event);
         return false;
       }
     });
   }
 };
 
 /**
  * Handler for the form redirection submission.
  */
