Name Capitalization 2 | JavaScriptSource

Name Capitalization 2

Will Bontrager Jun 22, 2007


This script will adjust capitalization of names (actually, the content of any form field you apply to it) so the first letter of each word is capitalized and the rest are lowercase. This is so easy to implement!

Your name:


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: nameCapitalization.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


This is a great, simple solution. I'd love to see an example that allows for multiple variables!

Adam Jul 11, 2008

I liked the Array idea to create toUppercase logic of capitalizing the name string with split options and creating a name[0] letter to capitalize very often. Great technique.[br /][br /]Thanks!

Aneel Goplani Jun 22, 2007