Onchange Client script response
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 08:40 AM
Hi All ,
Am using the below code in Catalog Client Scripts (variable set) onchange and using the below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// This is used for Consumable Ordering Portal
var cons = g_form.getValue('u_test');
// Call script include
var ga = new GlideAjax('test'); // Script include
ga.addParam('sysparm_name', 'getcount'); // Method
ga.addParam('test1', cons);
// Execute asynchronously
ga.getXML(getResponse);
}
function getResponse(response) {
var answer = response.responseXML.documentElement.getAttribute('answer');
g_form.setValue('total', answer);
}
when Item field is changed ,than above on change script will trigger and get the value set to total field ,But I need to click anywhere on the screen .so value is set to total field
after changes the item value ,use directly click on submit than total field is empty
Is there any way when Item filed changes than immediately it should trigger and set the value in total field
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 05:55 PM