- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 09:36 AM
Hi all,
So I have a catalog item with a lookup select box variable that has the "include none" option turned on. This field is dependent on a previous variable for population and mandatory. My problem is as long as "none" is an option it reads as mandatory but it thinks none is a selection so it marks it with a black asterisk. This is normally fine, but for one specific choice in the first variable I need it to either not have "none" as an option or I need my users to pick something else.
Is there a way to force this? Again I can't just uncheck the "include none" option since that needs to be there for every other scenario. I just need users to select something other than none if the first variable is a specific choice.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 08:18 PM
Hi Brad,
What you could do is to remove the option "include none", and create an entry that mimics it (Include none - No value).
When your first field changes, use an onLoad script to change the dropdown options.
For instance:
function onLoad(){
g_form.clearOptions('myDropdown');
if (g_form.getValue('field1') == "value1"){
g_form.addOption('myDropdown', 'option1', 'Option 1');
g_form.addOption('myDropdown', 'option2', 'Option 2');
}
else
{
g_form.addOption('myDropdown', '', 'None');
g_form.addOption('myDropdown', 'option1', 'Option 1');
g_form.addOption('myDropdown', 'option2', 'Option 2');
}
}
However, you mentioned that it's a lookup field?
Maybe you will then need to make an AJAX call to obtain the list of values and label from the server instead of hardcoding them like I just did.
I hope it helps!
Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 08:18 PM
Hi Brad,
What you could do is to remove the option "include none", and create an entry that mimics it (Include none - No value).
When your first field changes, use an onLoad script to change the dropdown options.
For instance:
function onLoad(){
g_form.clearOptions('myDropdown');
if (g_form.getValue('field1') == "value1"){
g_form.addOption('myDropdown', 'option1', 'Option 1');
g_form.addOption('myDropdown', 'option2', 'Option 2');
}
else
{
g_form.addOption('myDropdown', '', 'None');
g_form.addOption('myDropdown', 'option1', 'Option 1');
g_form.addOption('myDropdown', 'option2', 'Option 2');
}
}
However, you mentioned that it's a lookup field?
Maybe you will then need to make an AJAX call to obtain the list of values and label from the server instead of hardcoding them like I just did.
I hope it helps!
Alex