Today is . Page created 06/26/07

Name Name Capitalization Form Capital Letters

Your name:

Enter you name using lower case only.
Click submit and see what happens.

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.

We have tested the code in IE 7.0, Firefox 2.0.0.4, Opera 9.21, Netscape 9.0b1, Netscape 8.1.3, AOL Explorer 1.5 and Safari 3.0.2. This script worked well in all platforms with no variations observed.

For Your Information For your Information:     Before we begin, we feel obligated to advise you that the above form is for all intensive purposes a "Stand Alone" script. In other words, it really does not do much of anything other than what you see. In order to make it function as designed, you need to incorporate it into a valid working form. If you do not have a good Solid Knowledge of HTML coding, javascripts, forms, CSS Style Sheets and reconfigurations, please "Do Not Attempt" this until you are Proficient in the aforementioned areas.

Depending on your knowledge of HTML and javascripts, this is an easy two (2) part copy and paste code that goes in both the <HEAD> and <BODY> sections (incorporated into a working form) of your document. It also makes use of an external .js file you need to save and upload into your directory then add a snipplet of code into the <HEAD> section to call the external.js file.

There are some possible reconfigurations that can be made to the external.js file depending on the name of the form and what form field element* you want this effect associated with. See below where and howto.

Default Section of External.js File

// Two values need to be specified, the form name and the
// field name to be processed.

var FormName = "myform";
var FieldName = "name";

Reconfigured Section of External.js File

// Two values need to be specified, the form name and the
// field name to be processed.

var FormName = "consigliereform";
var FieldName = "myname";

Vertical Line Divider

<---- Default <BODY> Section ---->

<form name="myform">
Your name: <input type="text" name="name"><br>
<br><br>
<input type="button" value="Submit" onclick="return CapitalizeNames();">
<input type="reset" value="Reset">
</form>

<---- Reconfigured <BODY> Section ---->

<form name="consigliereform">
Your name: <input type="text" name="myname"><br>
<br><br>
<input type="button" value="Submit" onclick="return CapitalizeNames();">
<input type="reset" value="Reset">
</form>


*     The only downside we can see with this effect is that you can only add one form field element into the effect. Even if you add more reconfigurations into the external.js file, it still will not give you but one element that it will function with.

You can notice in the above, the reconfigurations have to reflect the same change within the external.js file and also the <BODY> section of code. They have to be the same or you will receive an error message in the task bar and wonder why.

Warning Logo     Note Of Importance:     If you are not sure of howto make the external .js file and make use of it within your document, grab the below link and it is fully explained.
.js File Howto ]

For Your Information For your Information:     If you are not comfortable or prefer not to use the external.js file, you can use the traditional cut/copy and paste instead of the external .js file. If you need a little refresher on what is required to achieve this, grab the below link and it is fully explained.
Traditional Cut/Copy and Paste ]

Depending on which of the above methods you have selected (external.js file or Traditional Copy/Cut & Paste), you will add either the snipplet of code (after you have uploaded the external.js file) into the <HEAD> section or the completed section of code that you added the opening and closing script tags.

Snipplet Of Code

<script type="text/javascript" src="nameCapitalization.js">
</script>
Traditional Copy/Cut and Paste

<SCRIPT LANGUAGE="JavaScript">

<HEAD> Section of code goes here

//  End -->
</script>

Arrow External .js file



Arrow Traditional Copy/Cut & Paste Code with opening & closing tags that you had to add into the <HEAD> section of code that was originally earmarked to be an external .js file.

If you would like to see an example of this effect using the "Traditional Cut/Copy & Paste" method, grab the below link and you are there. Examine our "Source" code (on the page you will be opening) to see how we had to reconfigure it to make it work. We have it very well documented for your convenience.
Traditional Cut/Copy & Paste Method ]

O nce you have completed either of the above steps for the <HEAD> section, all that is left is to incorporate the <BODY> section of code into a functional form.

We hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]   Digg It!