This looks great! However, it would be even better if it happened dynamically, ie started checking as a user types, without them having to click a button.

Comments

moshe weitzman’s picture

indeed. i think this is worthy of core with this change. for UI, not how drupal6 handles the password strength feedback.

stevebayerin’s picture

This would be great if the system checks for new user names when the user has typed in more than the minimum number of letters for a user name and the user has paused typing for more than 3 to 5 seconds .

ardas’s picture

We implemented it just like on Google :) but I think that we will add this feature. There will be a setting to choose the way it behaves: button or automatic check. I personally don't like when something is happened automatically :)

pepeek’s picture

This sounds great, any progress on it?
--Josef

ncameron’s picture

Needed similar functionality so I did a quick mod/hack of the js file. Replace all the code in username_check.js with:

if (Drupal.jsEnabled) {
  $(document).ready(function() {
    $("#edit-name").bind("blur", function() {
      var username = $("input[@id='edit-name']").val();
      $.getJSON(Drupal.settings.username_check.ajaxUrl,
        {username: username},
         function (data) {
           var message = $("div[@id='username-message']");
           message.html(data.msg);
           message.removeClass('username-message-progress');
           if(data.exists === true){
              message.removeClass('username-accepted');
              message.addClass('username-rejected');
           }
           else{
              message.removeClass('username-rejected');
              message.addClass('username-accepted');
           }
           message.show();
         });
      return false;
    });
    
    $("div[@class='username-message']").ajaxStart(function(){
      $(this).html(Drupal.settings.username_check.msgWait);
      $(this).removeClass('username-accepted');
      $(this).removeClass('username-rejected');
      $(this).addClass('username-message-progress');
      $(this).show();
    });


    $("div[@class='username-message']").hide();
  });
}

Enjoy !

Neil

grah’s picture

Thanks Neil, that works nicely.

ardas’s picture

Status: Active » Fixed

Thank you guys for all work you did. We have ported this module to Drupal 6 and added features you proposed to both Drupal 5 and 6. Releases will be ready soon. Please download it and test.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.