- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 07:17 AM
We have a request to remove an option from select box B if a user selects a specific option in select box A.
Here's the client script I created, but it doesn't seem to be working. For testing, I tried changing onChange to onCellEdit and onLoad but nothing worked.
the g_form.removeOption is working. The option is removed if I comment out the if statement and force the removeOption through.
| function onChange(control, oldValue, newValue, isLoading) { |
var phoneUser = g_form.getValue = ('phone_user_type');
if (phoneUser == 'CCE Phone User') {
return g_form.removeOption('desk_phone', 'reconfigure');
}
}
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 07:19 AM
Alexander, try this.
| function onChange(control, oldValue, newValue, isLoading) { |
var phoneUser = g_form.getValue('phone_user_type');
if (phoneUser == 'CCE Phone User') {
g_form.removeOption('desk_phone', 'reconfigure');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 07:20 AM
try this. There are few syntax errors
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var phoneUser = g_form.getValue('phone_user_type');
if (phoneUser == 'CCE Phone User') {
g_form.removeOption('desk_phone', 'reconfigure');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2016 06:02 AM
Thanks Abhinay, I gave this a shot but it still isn't working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2016 06:04 AM
Can you post your current script so we can take a look? We may be guessing at variables and values that need adjusting. Always assume code from the community is NOT going to work if you simply copy/paste.