CRM-13863 Focus first form element in popups
authorColeman Watts <coleman@civicrm.org>
Mon, 3 Mar 2014 01:59:10 +0000 (20:59 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 3 Mar 2014 01:59:10 +0000 (20:59 -0500)
js/Common.js

index 4771f2f8c6956d30df3b070c7c41d0b13f9708da..e7e480977ac8868286bc3e912c684ba630c3b8e5 100644 (file)
@@ -964,6 +964,8 @@ CRM.validate = CRM.validate || {
           return false;
         });
       }
+      // For convenience, focus the first field
+      $('input[type=text], textarea, select', this).filter(':visible').first().focus();
     });
     return widget;
   };