How to add an eventListener to a wrapper object in Catalog Client Scripts - Type: onLoad
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2025 11:59 AM
Please don't use AI since it provides outdated methods.
Hello folks! how can I add an eventListener to a wrapper object (see screenshot) in Catalog Client Scripts - Type: onLoad.
Currently I'm using a setInterval to grab the value of an element within the wrapper object, however I want to do it with a listener since the setInterval is time-based and not event-driven (onKeyup, input)
function onLoad() {
setInterval(function () {
var wrap = g_form.getControl('short_description');
g_form.showFieldMsg('short_description', 'Current length is:' + wrap.value.length + '. Max length 10 characters', 'error');
}, 1000);
This works fine but as I mentioned this is time-based and also noticed that I have to click away from the input in order to visualize the length, even though the JS console value is syncing correctly
0 REPLIES 0
