Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

How to convert entry field to Proper Case

I have uploaded a javascript file for my sharepoint site and then pointed the custom  javasript  link to it  under the "Custom JavaScript" the file looks like this. I  have used this code before to conver a string to ProperCase.

function toTitleCase(str) {
return str.replace(
/\w\S*/g,
function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
}
);
}

On the "On Column Value Change Event" for that column I have an Execute Script with the following

var city = _ccs_FormUI.fetchColumnValueUI("City"));
return toTitleCase(city);

Does not seem to work. Am I putting this in the wrong place? Any Suggestions would be greatly appreciated.

  • Hi @skigeek,
  • Please find steps to convert a column value to title case:
    1. Please update the JavaScript code by referring attached file. <Please refer CCS_TitleCaseJS.pdf>
    2. Configure an empty variable. This will be used in Form Event Actions in next steps. <Please refer TitleCase_1.png>
    3. Please find detailed steps to configure Form Event Actions for updating a column to title case.

    Note: In this example, we have configured FEA to update ‘Title’ column to title case. When ‘Title’ column value changes, it is required to convert the column value to title case.

      • Configure a FEA on column value change event: <Please refer TitleCase_2.png>
      • Add ‘Set Variables Value’ action. <Please refer TitleCase_3.png>
      • Map the ‘TitleCase’ variable configured in #2. above. <Please refer TitleCase_4.png>
        Note: Please find the attached script. <Please refer CCS_VariableMapping.pdf>
      • Add ‘Update form controls’ action.
        Condition: Advanced Condition ‘not equal’ TitleCase##Value,,  <Please refer TitleCase_5.png>
      • Column value mapping for ‘Title’ column. <Please refer TitleCase_6.png>
        Syntax: VariableName##Value
        Example: TitleCase##Value
Uploaded files:

Attached files.

Uploaded files: