Convert small letter to capital letter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:34 AM
There are two fields last name and name. So when I enter something in last name field. The first letter it needs to be populate in name field.
I used below code:
Using onchange
Var name1= g_form.getValue('lastname');
Var f1= name1.charAt(0);
g_form.setValue("name", f1);
So this code is working fine for autopopulate.
For ex: lastname- Testing
Name-t (small letter)the first letter is in small letter I need capital letter how to add that in this code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:39 AM - edited 11-01-2023 05:40 AM
Hi @User_267 ,
U can make use of this at below line of code
g_form.setValue("name", f1.toUpperCase());
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:41 AM
you can use toUpperCase() as shared by Danish
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader