- 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-13-2019 03:35 AM
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);
}
}}
Try this
- 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-13-2019 03:59 AM
Thanks, I removed the if condition, so it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2019 12:54 PM
You need to create an onChange catalog client script that sets the checkbox value to false whenever the request type field changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:22 AM
Hi, I have written the following script but it is not working. Can you please help?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'true'){
g_form.setValue('menu', false);
g_form.setValue('function',false);
}}