
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 02:54 AM
Hi,
I am trying to auto convert upper case to lower case. I wrote the code, but it is not working. Please let me know the mistake. Kindly help.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var new_Schema = g_form.getValue("new_schema_name");
newValue = new_Schema.toString().toLowerCase();
var len_Schema = new_Schema.length;
if (len_Schema > 15) {
g_form.addErrorMessage("The maximum characters entered can be 15");
g_form.clearValue("new_schema_name");
}
}
Regards
Suman P.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 02:58 AM
Hi @Community Alums
I don't believe you can set "newValue" to what you're trying to do and should instead, declare a new JavaScript variable and set that with your lowercase script. Additionally, per your code, you're not actually doing anything with it, so I'm unsure what you mean by it's not working. Per your code, you're checking character count and that has nothing to do with lowercase, etc.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 02:58 AM
Hi @Community Alums
I don't believe you can set "newValue" to what you're trying to do and should instead, declare a new JavaScript variable and set that with your lowercase script. Additionally, per your code, you're not actually doing anything with it, so I'm unsure what you mean by it's not working. Per your code, you're checking character count and that has nothing to do with lowercase, etc.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 03:18 AM
Thank you @Allen Andreas ,
I finally realized my mistake.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var new_Schema = g_form.getValue("new_schema_name");
var len_Schema = new_Schema.length;
if (len_Schema > 15) {
g_form.addErrorMessage("The maximum characters entered can be 15");
g_form.clearValue("new_schema_name");
}
g_form.setValue("new_schema_name", new_Schema.toString().toLowerCase("new_schema_name"));
}
Regards
Suman P.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 03:37 AM
Hi,
Glad you got it resolved and are now leveraging the actual lowerCase part of your script!
If my reply above helped guide you Correctly, please consider marking it as "Accept Solution".
Thanks and take care! 😀
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!