- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2019 12:16 PM
Hi,
I have created a catalog item, it has a selectbox variable with 4 choices, I want that whenever I change the choices, the Checkboxes variables I have made (Menu and function) should uncheck.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'true'){
g_form.setValue('menu', false);
g_form.setValue('function',false);
}}
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:46 AM
If you want it to be unchecked when ever the choice is changed remove the if condition
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.setValue('menu',false);
g_form.setValue('function',false);
}
and if you want to it to be unchecked only if a patricular choice is selected use the below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var c=g_form.getValue('contact_type');// replace the 'contact_type' with your field name
if(c=='')// enter the choice which you want to trigger
{
g_form.setValue('menu',false);
g_form.setValue('function',false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2019 12:27 PM
Hi
your requirement is not clear what you want to achieve?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:23 AM
Hi,
I want that whenever request type value changes, the Menu and Function checkbox should uncheck. I have written the following script but its not working.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'true'){
g_form.setValue('menu', false);
g_form.setValue('function',false);
}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:27 AM
change the code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.setVisible('menu',false);
g_form.setVisible('function',false);
}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:33 AM
I tried it. This is not working, it is hiding both the checkboxes. I want to make them uncheck on changing the choice.