Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-18-2012, 03:06 PM   PM User | #1
Bobski101
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Bobski101 is an unknown quantity at this point
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
Bobski101 is offline   Reply With Quote
Old 09-18-2012, 03:44 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
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).
devnull69 is offline   Reply With Quote
Old 09-18-2012, 04:03 PM   PM User | #3
Bobski101
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Bobski101 is an unknown quantity at this point
Okay that makes sense thank you!

How would I go about doing that?

Thanks
Bobski
Bobski101 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:27 PM.


Advertisement
Log in to turn off these ads.