Telligent Community 6.x: change the text of the minimum username length error.

Telligent Community 6.x: change the text of the minimum username length error.

This question is answered

All,

We want to localize the username minimum length error message, but can't find the error message "Please enter at least 3 characters."

Regards,

Steve

Verified Answer
  • This is the default message for the jQuery validation on the client-side.  It can be customized within the User - Login and Create widget's ui.js file.  Replacing

    if(context.inputs.username.length > 0) {
      context.elements.createAccountLink.evolutionValidation('addField',
        context.inputs.username,
        {
          required: true,
          minlength: context.usernameMinLength,
          maxlength: context.usernameMaxLength,
          username: true,
          usernameexists: true,
          messages: {
            username: context.resources.usernameInvalidUserName,
            usernameexists: context.resources.usernameDuplicateUserName,
            required: context.resources.fieldRequired
            }
        },
        context.inputs.username.closest('.field-item').find('.field-item-validation'), null);
    }

    with

    if(context.inputs.username.length > 0) {
      context.elements.createAccountLink.evolutionValidation('addField',
        context.inputs.username,
        {
          required: true,
          minlength: context.usernameMinLength,
          maxlength: context.usernameMaxLength,
          username: true,
          usernameexists: true,
          messages: {
            username: context.resources.usernameInvalidUserName,
            usernameexists: context.resources.usernameDuplicateUserName,
            required: context.resources.fieldRequired,
            minlength: 'MESSAGE'
    } }, context.inputs.username.closest('.field-item').find('.field-item-validation'), null); }

    will show the "MESSAGE" when the minlength rule fails.

All Replies
  • This is the default message for the jQuery validation on the client-side.  It can be customized within the User - Login and Create widget's ui.js file.  Replacing

    if(context.inputs.username.length > 0) {
      context.elements.createAccountLink.evolutionValidation('addField',
        context.inputs.username,
        {
          required: true,
          minlength: context.usernameMinLength,
          maxlength: context.usernameMaxLength,
          username: true,
          usernameexists: true,
          messages: {
            username: context.resources.usernameInvalidUserName,
            usernameexists: context.resources.usernameDuplicateUserName,
            required: context.resources.fieldRequired
            }
        },
        context.inputs.username.closest('.field-item').find('.field-item-validation'), null);
    }

    with

    if(context.inputs.username.length > 0) {
      context.elements.createAccountLink.evolutionValidation('addField',
        context.inputs.username,
        {
          required: true,
          minlength: context.usernameMinLength,
          maxlength: context.usernameMaxLength,
          username: true,
          usernameexists: true,
          messages: {
            username: context.resources.usernameInvalidUserName,
            usernameexists: context.resources.usernameDuplicateUserName,
            required: context.resources.fieldRequired,
            minlength: 'MESSAGE'
    } }, context.inputs.username.closest('.field-item').find('.field-item-validation'), null); }

    will show the "MESSAGE" when the minlength rule fails.

  • @ben,

    you are super, it works now!

    regards,

    Steve