Store names in proper case

You can automatically convert names to proper case before they are saved to the database.

For example:

  • bill gates becomes Bill Gates
  • sam fowler becomes Sam Fowler

This example applies the conversion to the UserName field when a record is added or updated.

1. Add the code to the Before record updated event

Open the Edit page: Before record updated event and add the following code.

PHPRunner

ASPRunner.NET

Replace UserName with the field name from your own table. Field names are case-sensitive.

2. Add the same code to the Before record added event

Add the same code to the Add page: Before record added event.

This ensures that the name is converted to proper case both when a new record is added and when an existing record is edited.

Result

If a user enters:

sam fowler

the value will be stored in the database as:

Sam Fowler

Applies to

  • PHPRunner
  • ASPRunner.NET

Back to top