See also: fvInitialCap

Converts a fields alphabetic characters to a proper-name.

Syntax

JSV_fsInitialCap(expO [, PROPERNAMES, RESETCASE])

Prototype

n/a

Returns

n/a

Parameters

The fsInitialCap function uses the following arguments.

Argument Description
expO The object.
PROPERNAMES Optional. Handles the capitalization of two surname types (i.e., last names): those names that contain a single quote (e.g., O'Malley) and those names that start with 'Mc' (e.g., McCoy).
RESETCASE Optional. Converts the entire string to lowercase before capitalizing each word. Useful for those instances where the string may be passed in ALL CAPITAL LETTERS. See Argument Placement below.

Remarks

Argument Placement

The arguments RESETCASE and PROPERNAMES can appear in any order with the string that is to have its first character capitalized.

For example,
fsInitialCap(expS, RESETCASE, PROPERNAMES),
fsInitialCap(RESETCASE, PROPERNAMES, expS),
fsInitialCap(RESETCASE, expS, PROPERNAMES)
and
fsInitialCap(expS, RESETCASE)
are valid calls to the fvInitialCap function.

Dependencies

JSV_capitalizeFirstCharacter

Example

The following lines of code

function CheckField() {
    alert( JSV_fsInitialCap(document.InitCapForm.MyValue.value, PROPERNAMES) );
}

<FORM NAME="InitCapForm">
<B>Name:</B>
<INPUT TYPE="Text" NAME="MyValue" VALUE="o'malley" SIZE="16" MAXLENGTH="16">
<INPUT TYPE="Button" NAME="ICButton" VALUE="Check" onClick="CheckField();">
</FORM>

produce

Click the Check button.

Name: