Bruce,
The inline javascript Ive tried works fine, but for some reason, I cannot get the functions like the one Alan Cochran did (and others built like it) to work. It's like they don’t have access to this.value or something.
function toProperCase(s)
{
return s.toLowerCase().replace(/^(.)|\s(.)/g,
function($1) { return $1.toUpperCase(); });
}
This is one Bob found on the net (at
http://www.codeproject.com/jscript/propercase.asp ) that works fine in a regular page, but I cannot get it to return a capitalized value - or ANY value for that matter.
At one point, I had it doing this, just to see if it would give me anything.
In the validation field in the Nt4 app for this field, it says 'toProperCase(this.value);'
function toProperCase(s)
{
var txtstr = s;
txtstr.toUpperCase();
alert('after upper ' + txtstr);
txtstr.toLowerCase();
alert('after lower ' + txtstr);
txtstr.toLowerCase().replace(/^(.)|\txtstr(.)/g,
function($1) { return $1.toUpperCase(); });
alert('after replace ' + txtstr);
return txtstr;
}
When I type "firstname" in the field and press tab, the alerts produced these messages:
after upper firstname
after lower firstname
after replace firstname
IE: none of the toUpperCase stuff ever took. Tested on FF 2.006 and IE7 on Vista. Same results.
Clearly I missing something. Got an idea what it might be?<g>
Mark