Solved
Dependent Listbox doesn't retain value on save and then open
- October 21, 2025
- 1 reply
- 1022 views
I have two list boxes (MathCAD Prime 11.0.0.0), The selection of one list box drives the list of the other box (see picture). The problem I have is the values update on re-opening the sheet. I can get the sheet to remember the 'Type' selection. However I can't get the second list box to remember the selection from the previous save and close. Below is the code in the jscript:-
// TODO: Add your initialization code here
ListBox.ResetContent();
// Add Strings here as needed
function ListBoxEvent_Start(Inputs, Outputs) {
// TODO: Add your code here
ListBox.ResetContent()
if(Inputs[0].Value=="UC"){
ListBox.AddString("356 x 406x 1299");
ListBox.AddString("356 x 406x 1202");
ListBox.AddString("356 x 406x 1086");
ListBox.AddString("356 x 406x 990");
... (the full script code is attached)
So I know/suspect the issue is the 'ListBox.ResetContent()' line but how do I stop the script running on open or remembering the selection, so that it keeps the previous save options?
The sheet options are shown in the screen grab 'sheet options selections.png', I have seen that if items in this list to do with scripts could be a solution, but the check options don't look they would help as they are to run scripts.
Any ideas?

