»
EnglishFrenchVietnamese

Print - Copy Name - JavaScriptBank.com

Full version: jsB@nk » Form » Copy Name
URL: https://www.javascriptbank.com/copy-name.html

Copy Name © JavaScriptBank.comAllows the user to enter their name in the first field and have copies it to the second field for use as the User ID. It occurs instantly when they click the next field or the submit button. And, if the user tries to modify the second field, it is changed back to the value of the name field. Definitely a good example of the onChange() event handler in use.

Full version: jsB@nk » Form » Copy Name
URL: https://www.javascriptbank.com/copy-name.html



HTML
<pre><form name=userform>Name:     <input type=text name=name size=15 value="" onChange="this.form.userid.value=this.value;"><br>User ID:  <input type=text name=userid size=15 value="" onChange="this.value=this.form.name.value;"><p><input type=button name=action value="Done!"> </form></pre><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->