Convert to Title Case

Home Forum General Convert to Title Case

Tagged: 

This topic contains 1 reply, has 0 voices, and was last updated by  sturmeyp 7 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #744

    sturmeyp
    Participant

    Hi

    There are functions to convert fields to Uppercase, and Lowercase

    Is there a simple way to convert a field to title case

    For example if I enter martin smith into text input field how can i convert to Martin Smith

    thanks

    #5685

    There is no function built for this behavior but you can do it with some gymnastics:

    For your reference here is a list of the functions and how they work: http://www.perfectforms.com/Documentation/manual/html/?functions.htm.

    Use the Index Of function to find the position of the ” ” (space between names), put that number in a hidden helper field. Use Sub Text function to Place the characters starting at 0 and going to that number position in the helper into another hidden helper field. That is the First name. Use Sub Text function to take the first character of the first name and put it in a hidden helper. When that helper changes field data use the Uppercase function. Use the Sub Text function on the first name to remove the first letter. set your first name field with the value of the helper field with the first letter capitalized plus the first name field.

    Repeat the process for the last name, starting from the character position where the space is to position 99 to get the whole last name allowing for many characters. There will be a space at the beginning so use the Trim function.

    When the first and last names have capitals at the front you can set the field using the first name helper plus a space plus the last name helper.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.