onchange client script not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 05:01 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 6) {
g_form.setMandatory('close_code', true);
g_form.setMandatory('close_notes', true);
// g_form.setDisplay('assignment_group', false);
} else {
g_form.setMandatory('close_code', false);
g_form.setMandatory('close_notes', false);
// g_form.setDisplay('assignment_group', true);
}
}
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 06:23 AM
@laxmilinux1 Could you please check the following and se if it works.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == '6') {
g_form.setMandatory('close_code', true);
g_form.setMandatory('close_notes', true);
// g_form.setDisplay('assignment_group', false);
} else {
g_form.setMandatory('close_code', false);
g_form.setMandatory('close_notes', false);
// g_form.setDisplay('assignment_group', true);
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 07:56 PM
Hi @laxmilinux1
The script you have written is correct but please check the second line where you have missed a quote after new value.
change it from newValue===" to newValue === " ", this will wwork.
Regards,
Rakesh Darshnala