Name Capitalization 2 | JavaScriptSource

Name Capitalization 2

Will Bontrager Jun 22, 2007

General

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:

Notes

Source Code

Paste this source code into the designated areas.

External file

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


Head

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


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(2 comments)

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