- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 07:00 PM
Hi,
I am trying to set a checkbox variable in the service catalog to true when you select a certain item. My code below:
if (g_form.getValue('og_name') == 'Onboarding'){ | ||
alert(g_form.getValue('active_directory')); | ||
g_form.setValue('active_directory', true); | ||
alert(g_form.getValue('active_directory')); |
I added the alerts in to see what the value of the variable is before and after. When I run it, it first comes up false(which is correct) and then after it says it is true (which is also correct). The problem is the checkbox does not actually check off...
Does anyone have any thoughts?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 09:13 PM
Replace your code line - g_form.setValue('active_directory', true); with g_form.setValue('active_directory', 'true');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 08:43 PM
When setting client-side values you're always setting a string of some sort (even though this doesn't make sense for a boolean field). You should try true in quotes and see if that makes a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 09:13 PM
Replace your code line - g_form.setValue('active_directory', true); with g_form.setValue('active_directory', 'true');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2014 06:45 AM
Thanks, so many little things to remember. I had tried quotes but I had put True in the quotes not true.