I have a registration page where I have first and last name with javascript tags on each one so that it will automatically capitalize the first letter of each name in case the person didn't do it. The problem I am running into is that in the last name field, there are some cases where a person with the name McCoy or McDonald would want to capitalize the 3rd letter of their last name. How can I make it so it ignores the 3rd character in the last name field but checks the characterization with the rest? Here is my code so far: <script language="JavaScript" type="text/javascript"> //"Accept terms" form submission- By Dynamic Drive //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com //This credit MUST stay intact for use var checkobj function agreesubmit(el){ checkobj=el if (document.all||document.getElementById){ for (i=0;i<checkobj.form.length;i++){ //hunt down submit button var tempobj=checkobj.form.elements[i] if(tempobj.type.toLowerCase()=="submit") tempobj.disabled=!checkobj.checked } } } function defaultagree(el){ if (!document.all&&!document.getElementById){ if (window.checkobj&&checkobj.checked) return true else { alert("Please read/accept terms to submit form") return false } } } function changeCase(frmObj) { var index; var tmpStr; var tmpChar; var preString; var postString; var strlen; tmpStr = frmObj.value.toLowerCase(); strLen = tmpStr.length; if (strLen > 0) { for (index = 0; index < strLen; index++) { if (index == 0) { tmpChar = tmpStr.substring(0,1).toUpperCase(); postString = tmpStr.substring(1,strLen); tmpStr = tmpChar + postString; } else { tmpChar = tmpStr.substring(index, index+1); if (tmpChar == " " && index < (strLen-1)) { tmpChar = tmpStr.substring(index+1, index+2).toUpperCase(); preString = tmpStr.substring(0, index+1); postString = tmpStr.substring(index+2,strLen); tmpStr = preString + tmpChar + postString; } } } } frmObj.value = tmpStr; } var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } function aolWindow() { window.open('aol.cfm','','height=300,width=200,resizable=yes,scrollbars=no'); } function findUS() { var len = document.SignUpForm.countryid.options.length; for (i=0;i<len;i++) { if (document.SignUpForm.countryid.options[i].value == 198) { document.SignUpForm.countryid.selectedIndex = i; } } } function forceCountry() { var index = document.SignUpForm.countryid.selectedIndex; if (document.SignUpForm.countryid.options[index].value != 198) { document.SignUpForm.stateid.selectedIndex = 0; } } function phanatic() { var chosen = document.SignUpForm.hearabout.options[document.SignUpForm.hearabout.selectedIndex].value; if (chosen >= 16 && chosen <= 21) { var which1=prompt('Which one?',''); document.SignUpForm.WhichOne.value=which1; //document.SignUpForm.hearabout.options[document.SignUpForm.hearabout.selectedIndex].text=document.SignUpForm.hearabout.options[document.SignUpForm.hearabout.selectedIndex].text+' - '+which1; } } </script> Code (markup): Last:<br /> <input type="text" size="50" maxlength="25" name="lastname" required="YES" message="Please enter you Last Name" onChange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length); while(''+this.value.charAt(this.value.length-1)==' ')this.value=this.value.substring(0,this.value.length-1); changeCase(this.form.lastname);" value="<cfoutput>#lastname#</cfoutput>" /> Code (markup):