| Subject |
Re: Change Upper Case |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Sun, 2 May 2021 10:57:10 +0200 |
| Newsgroups |
dbase.getting-started |
On 2021/05/02 09:51, Mervyn Bick wrote:
> The following simple code will ensure that the first character remains
> upper case and the subsequent characters are in lower case.
"Fixing" the existing records is a once-off exercise so a simple little
XDML program is all that is needed.
The next step is to ensure that your data capture routine doesn't let
any badly formed strings through in future.
There are various ways to do this but probably the easiest way is to use
the form rowset's canSave() event handler to do the job.
function rowset_canSave()
this.fields['fieldname'].value =
upper(substr(this.fields['fieldname'].value,1,1))+lower(substr(this.fields['fieldname'].value,2))
return true
Again, life is a bit more complicated if any word other than the first
word needs to start with uppercase but let's cross that bridge if it
becomes necessary.
Mervyn.
|
|