Fixing the Blackbaud NetCommunity Login Form

Blackbaud NetCommunity 6.15 has a bug in the login form, where tabbing onto the “Remember Me” field and pressing enter (normal functionality to submit a form) will take you back to the login form, with your username filled in, but no password or error. This is due to the fact that javascript is being (poorly) added directly to the HTML tags, instead of writing a simple, unobtrusive javascript function, that targets all fields on the form.

To remedy this, add a JS file to any layout that may contain a login field, and add this code:

1
2
3
4
5
6
7
8
9
10
$(function() {
  if (($loginForm = $('.LoginFormTable')).length > 0) {
    $('input[type!=submit]', $loginForm).keypress(function(e) {
      if ((e.which && e.which == 13) || (e.keyCode && event.ke == 13)) {
        $('input[type=submit]', $loginForm).click();
        return false;
      } else { return true; }
    });
  }
});

Comments