I am running an app where a rails 3 app where a user creates a subdomain -> xxxxx.myapp.com
Currently, the signup form has a field for this, but ideally I’d like to have the user enter their company name, and have their subdomain automagically created using jQuery or something like that.
For example,
If the company name entered is Rogers Cable, the subdomain would be rogers-cable or rogerscable. (Ideally this would update on each keystroke, but also when the form field is no longer in focus woudl work)
I am sure there must be a Jquery library or simple technique to do this around, but I am an absolute jQuery noob, so I’ve been having a hard time finding it.
Thanks for your help in advance.
and a fiddle to play
and an on change version:
edit else there is this alternative, with timeout (note this version accepts “-“)