function updateName(THIS){ THIS.form.F01_NAME.value = THIS.form.LastName.value + ", " + THIS.form.FirstName.value } function properField(THIS) { txt=THIS.value.toLowerCase() len = txt.length index = 0 while (index < len) { // Skip whitespace while (index < len) { ltr = txt.charAt(index); if (ltr == " ") { ++index } else { break; } } // Capitalize the 1st letter if (index < len) { ltr = txt.charAt(index); txt1 = txt.substring(0, index) + ltr.toUpperCase() + txt.substring(index + 1, len) txt = txt1 ++index } // Skip the rest of the word while (index < len) { ltr=txt.charAt(index); if (ltr != " ") { ++index } else { break; } } } THIS.value=txt; }