CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   Random Username Generation (http://www.codingforums.com/showthread.php?t=273475)

Bobski101 09-18-2012 03:06 PM

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

devnull69 09-18-2012 03:44 PM

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).

Bobski101 09-18-2012 04:03 PM

Okay that makes sense thank you!

How would I go about doing that?

Thanks
Bobski


All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.