Just got "JavaScript - The Definitive Guide" and tried my best at writing out the following code based off sample code I found from this site's "ListProgramming_Part1.pdf":
function SetHeroicEntries() { var oAssemblyParts = { Cleric: [ ["-","None"], ["Angelic_Avenger"], ["Divine_Oracle"], ["Radiant_Servant"],["War_Priest"]], Fighter: [ ["-","None"], ["Iron_Vanguard"], ["Kensei"], ["Pit_Fighter"],["Sword_Master]], }; if(event.willCommit) { var lst = oAssemblyParts[event.value]; if( (lst != null) && (lst.length > 0) ) this.getField("ClassParagon").setItems(lst); else { this.getField("ClassParagon").clearItems(); } } }
To begin, I have a combobox called ClassHeroic that for now has the options of Cleric and Fighter. The script above I tried entering as a document level script and was going to add the function as a custom keystroke format; this is what was done in the example file.
I keep getting an error at Cleric regarding a literal. As much as I read the book, I have no idea what this means and am not knowing where to troubleshoot this.
My long term goal will be that once Cleric is selected another combobox (ClassParagon) will be made active with the Paragon selections in the array. I was also looking to have powers (power1 through 29) be made available in other selection boxes (comboboxes AtWill1 through 8 and Encounter1 through 10 and Daily1 through 10 and Utiiity1 through 8) elsewhere on the same sheet. I have no idea if that can be done. Is there another way for coboboxes to become active with selections based on the selection of one combobox? THis is a really big job I'm trying to tackle without know anything about javascript.
Am I trying to do something that can't be done?
Thanks in advance for any help anyone can provide in this.
Jim
What you want to do can certainly be done. You're on the right track at least.
George