How to set all field values in lower case on catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 08:56 AM
I want all the field values on catalog item in lower case, since there are around 50 fields on form it is not a good idea to write all 50 on change client scripts an make each field content to lower case. This is tedious and have performance impact.
Is there any other way to implement this.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:08 AM
Hi @Phanindra N ,
You can try creating On Submit catalog client script, So it will be processing only on submission.
Please mark helpful if it helped with your query,
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:15 AM
@Phanindra N Please see if the following script works for you.
function onSubmit() {
// Get all field names
// Loop through the fields to get their values
for (var i = 0; i < g_form.elements.length; i++) {
var fieldName = g_form.elements[i].fieldName;
var fieldValue = g_form.getValue(fieldName);
// Check if the field value exists
if (fieldValue) {
// Convert the value to lowercase and update the field
g_form.setValue(fieldName, fieldValue.toLowerCase());
}
}
// Optional: Perform additional actions or validations based on field values
// Return true to allow submission, or false to block submission
return true;
}