Select Box choices dependant on another Select Box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2017 12:47 PM
Can I do this without creating a new table?
I have two variable select boxes.
The first one has choices A, B and C.
My second select box has choices, but they are dependant on what is selected on Select Box one.
Someone suggested that I add my choices to variable Select Box one (like normal), and then with Select Box two, choose the sys_choice table for "Choice Table" and Value for "Choice Field."
Then go to they sys_choice table and add:
Table: sc_req_item
Element: (my select box one field)
Lable: the label of one of my select box two choices
Value: the value of one of my select box two choices
depends on: the choice of on of the select box one choice.
and keep adding for each select box 2 choice.
Unfortunately this is not working. Am I missing something? Or is the only way to do this is with a table and a client script?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2019 03:31 AM
Hi booher,
Correction-> Remove the 's' i.e. use addOption not addOptions.
Thanks & Regards,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 04:16 PM
This worked great for me, thank you for posting!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 04:11 PM
Hi i tried using the same code in my account but invain its not working
var num = g_form.getValue('number');
g_form.addInfoMessage('NUM :: ' + num); // just so that we see what Value num realy has.
g_form.clearOptions("alphabet");
if ( num == "aa"){
g_form.addOption("alphabet","80","11");
}
else if ( num == "bb"){
g_form.addOption("alphabet","90","22");
}
}
can you help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 10:50 AM
Try this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == ''){
return;
}
var num = g_form.getValue('number');
g_form.addInfoMessage('NUM :: ' + num); // just so that we see what Value num realy has.
if(num == "aa"){
g_form.clearOptions('alphabet');
g_form.addOptions('alphabet', '80', '11');
}
else if(num == "bb")
g_form.clearOptions('alphabet');
g_form.addOptions('alphabet', '90', '22');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 05:49 AM
Hii @kemmy1
we have same requirement
but script is not working - can you plsease see the script - if we did any mistake - let me know
Thanks