make names look better when entered in a web form.
[JS Header]
----------------------------
function pcase(str) {
strlen = str.length
jj = str.substring(0,1).toUpperCase()
jj = jj + str.substring(1,strlen).toLowerCase()
for (i = 2; i <= strlen; i++) {
if (jj.charAt(i)==" ") {
lefthalf = jj.substring(0,i+1)
righthalf = jj.substring(i+1,strlen)
righthalf =
righthalf.substring(0,1).toUpperCase()+righthalf.substring(1,strlen)
jj=lefthalf+righthalf
}
}
return jj
}
[onBlur]
----------------------------
field.value = pcase(field.value)
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
This was first published in November 2000