Here is my situation. I have a form with MULTIPLE select boxes. the select boxes are all named using the following convention "sel" + a Unique identifier. Example name is selRWorms or selThyroid
I have 25 plus select boxes. Virtually all of them have nothing but numeric options.
I have a user that is willing to maintain the options if it's easy. (As in NO CODE to be modified)
So, what I need is 2 very specific thingss
1. I need a function in the htm file that can read the js file as shown below or something very similar and populate the the options for each select box. THe function or code needs to populate the options when the page loads. Once loaded, the options will not change.
2. A js file with the options. I was thinking about the format of this js file and I believe I can get away with one little bit of code. The format I was thinking about is
OptionArray[OptVar++] = "SelBoxName", "Option Value", "Option Label"
I can tell her just to copy the stuff to the left of the equal sign and give her instructions on the other 3 parts of the line. Using this type format, I should be able to create an array that would have all the select box options in the array. I don't know if this is possible, but I hope so. The Option Value's are mostly numeric and i know how to deal with that..
Please understand. I'm pretty new at Javascript. I also MUST have it with the absolute bare minimum in the js file otherwise I get stuck maintaining the options. (Not something I am willing to do).
I don't care if the code is in more than 1 function but the js file must be completely separate.
Please do not give me any solutions that include actual code in the js file.
Oh, I did not provide a listing of my code because this is something that is totally separate and is Just to populate select boxes.
If you want some context, build a form with 2 or 3 select boxes with names in a table structure, and you have what my form looks like.
Thanks
OldHatt45
Start Free Trial