Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Random Username Generation

    Hi CF,

    I am working on a new project and need some help with something.

    I have a working registration form with the layout:

    USERNAME
    EMAIL
    PASSWORD.

    I need this to change. I need the USERNAME to be auto generated within the HTML Text Field.

    The text field should not be able to be edited and the username has to have a prefix with 8 digits.

    example.

    SMH12345678

    I would assume this has to be done with JS and so am posting it in here. if it has to be moved then thats fine.

    Thanks for your help in advanced

    Bobski

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,387
    Thanks
    11
    Thanked 565 Times in 558 Posts
    I presume the username must be unique?

    If yes, then this cannot be a JS task only. You'd have to generate a random username and then check its availability server-side.

    So I'd propose to create the random username directly on the server and return a new username to the browser (while blocking it in the database by already creating it as a temporary user).

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay that makes sense thank you!

    How would I go about doing that?

    Thanks
    Bobski


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •