Spaces in Username

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • majsm
    Member
    • Oct 2009
    • 74

    [Forum] Spaces in Username

    How can I disable the space bar as a character in registration to prevent registration with a space?
    define('DISABLE_HOOKS', true);
    Adding the above to config.php will save your life when encountering SQL errors!
    http://www.worldslargestforum.com/forum/
  • Deadly Stream
    Member
    • Mar 2008
    • 82

    #2
    Go to User Registration Options in the Admin Control panel (AdminCP > Settings > Options > User Registration Options).

    Scroll down to Username Regular Expression and enter the following into the field;

    Code:
    ^[A-Z0-9]+$
    That will only allow names with A-Z & 0-9 without spaces. If you only wanted to allow letters and not numbers, use this code;

    Code:
    ^[A-Z]+$
    Epic sunburn!

    Comment

    • majsm
      Member
      • Oct 2009
      • 74

      #3
      but the help menu says this "^[A-Z0-9 ]+$ - Alphanumeric characters including space"

      doesn't this mean this will allow letters numbers and spaces?
      define('DISABLE_HOOKS', true);
      Adding the above to config.php will save your life when encountering SQL errors!
      http://www.worldslargestforum.com/forum/

      Comment

      • Deadly Stream
        Member
        • Mar 2008
        • 82

        #4
        That one will because of the space between 9 & ]. If you remove the space then users can't use them.
        Epic sunburn!

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...