
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:40 AM
Hi,
I need to remove options for a field - incase the field was changed to a certain value (NOT SUBMITTED).
Usually I would think an on change client script should do the job ... something like:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('abc_status' == '900')) {
g_form.removeOption('abc_status', 100);
g_form.removeOption('abc_status', 200);
}
}
It doesn't work ... could anyone please tell me why?!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:43 AM
sorry .. missed the ' ' ... anyhow not working ...
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('abc_status' == '900')) {
g_form.removeOption('abc_status', '100');
g_form.removeOption('abc_status', '200');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:46 AM
Hi,
Please use the below script, and give it a try:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (g_form.getValue('abc_status' == '900')) {
g_form.removeOption('abc_status', '100');
g_form.removeOption('abc_status', '200');
}
}
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:46 AM
Have you made a log to see that it goes into the if statement?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:51 AM
gs.log not allowed within client script ... . How to add log?
Sorry - I'm a low-code bro 😉