问题描述:

Firstly, I'm self taught at programming so I apologize for any lack of basic knowledge I may possess about javascript.

I'm trying to collate an array out of many multiple check boxes which have been set as either "off" or outputting a 5 digit value in adobe acrobat for a PDF form. I can get the array formed. I cannot figure out how to take the array and have it select one of the array values and display just that one value on a distinct field.

What I'm looking to do is have the array display it's three values which have been collated from around 20+ different check boxes that could be checked into three separate fields.

Basically, a check box is a type of surgery which then corresponds to a particular billing code (5 digits) that I want to program to have displayed on separate lines which I will then pair with a diagnosis of disease code. I am not able to figure out how to split up the values from the array.

ex:

var aFieldNames = new Array("ORIF Patella","TKA","ACL Repair");

var cSurgery = "";

var aSxCode = new Array();

for (i = 0; i < aFieldNames.length; i++) {

cSurgery = this.getField(aFieldNames[i]).value;

if(cSurgery != "Off") {

aSxCode[aSxCode.length] = cSurgery;

}

I left out the incredibly long list of other check boxes and used only three in the example. This gets the array set up but I have no idea how to go about starting to sort the values into separate variables to be displayed. I'm not planning on more than three check boxes ever being checked at one time so am not bothering to code in a restriction to only three values.

Thanks for any help and guidance you can give me.

相关阅读:
Top