Can jQuery dynamically change a "username" field based on a "name" field?

Posted by SoulieBaby on Stack Overflow See other posts from Stack Overflow or by SoulieBaby
Published on 2010-06-18T00:23:23Z Indexed on 2010/06/18 0:33 UTC
Read the original article Hit count: 248

Filed under:
|
|
|
|

Hi all, basically I have two input fields, "name" and "username".

The idea is that the "username" field will change depending on what is entered into the "name" field - dynamically. I also need the username field to be in lowercase only and to change spaces into dashes. I was thinking using onkeydown but I couldn't get it to do anything.

I've been looking around, but can't seem to find what I'm looking for. Anyone got any ideas?

<input type="text" name="name" id="name" class="field" />
<input type="text" name="username" id="username" class="field" />

^^ basic form inputs.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about update