
- 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 02:23 AM
Saw you found your typo..
but you can use console.log to log in the web browser or just put a alert("inside"); inside the if-statement and see if it pops up
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:49 AM
condition should be
if (g_form.getValue('abc_status') == '900') {

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:51 AM
Hi Vemffm,
I believe there was a mistake in this line of your code " if (g_form.getValue('abc_status' == '900'))"
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//can you modify something as bellow and try it.
var x = g_form.getValue('abc_status');
if (x == '900')) {
g_form.removeOption('abc_status', 100);
g_form.removeOption('abc_status', 200);
}
}