Real time update on a field as the user types, instead of waiting for on onChange event
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 09:25 AM
I need to create a field on a catalog item where, as a user types, a space is automatically added after every four characters without waiting for the user to leave the field or move the cursor.
A standard onChange Client Script only trigger when the user leaves the field, which is not work as i want.
So i create a UI Macro
as above code a event listener called every time when user input any character to field and add space after every four character.
add this macro to field attribute as "ui_macro = <UI Macro Name>".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2025 10:09 PM
I won't recommend using this.
What's your question here?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2025 05:44 AM
While the user is typing, automatically add a space after every four characters before they leave the field or move the cursor away.