- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2019 03:42 AM
Hello,
I have to compare two reference values from two different tables in onChange client script and am stuck, it works for one, but not sure how to implement the logic to actually compare the values...Any suggestion what is wrong with my script? Please do not tell me that this can be achieved with GlideAjax, I know that but chose this way as it seems easier and more reliable for my case.
function onChange(control, oldValue, newValue, isLoading) {
g_form.getReference('u_one_field', validation);
g_form.getReference('u_second_field', validation);
}
function validation(demo, show) { // reference is passed into callback as first arguments
if(demo.active === 'true' && show.u_rule === '2'){
g_form.showFieldMsg('u_one_field','TEST','info');
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2019 05:20 AM
Thanks it might work, however I fixed it like this (without the callback function)
var demo = g_form.getReference('u_one_field').active;
var show = g_form.getReference('u_second_field').u_rule;
if(demo === 'true' && show === '2'){
g_form.showFieldMsg('u_one_field','TEST','info');
}
Thanks for posting actual helpful answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2019 05:50 AM
glad, you solved it, yes this way you can also fulfill your request. i just answered based on the script you had posted.