I need another way to run this code
First I am a novice at best...but learning
I have a form that has a worksheet the user will complete prior to filling out the form. The worksheet is a series of 71 check boxes that will assign a category value...1, 2, or 3, and populate 1 or more text boxes with different instructions.
There are 15 discreet groups of category and text box combinations possible depending on which checkbox is selected.
Check boxes are named cbGroup1.1, cbGroup1.2....cbGroup15.1...
The function below is called from a mouseup event in the checkbox field.
function setText(){
if (this.getField('cbGroup1.3').value == 'Yes') {
this.getField('rptCategory').value = 'CATEGORY 1';
this.getField('rptInfo.1').value = 'Instruction one';
this.getField('rptInfo.1').display = display.visible;
this.getField('rptInfo.2').value = 'Instruction two';
this.getField('rptInfo.2').display = display.visible;
this.getField('rptInfo.3').value = 'Instruction three';
this.getField('rptInfo.3').display = display.visible;
this.getField('rptInfo.5').value = 'Instruction four';
this.getField('rptInfo.5').display = display.visible;
this.getField('rptInfo.6').value = 'Instruction five';
this.getField('rptInfo.6').display = display.visible;
this.getField('rptInfo.7').value = 'Instruction six';
this.getField('rptInfo.7').display = display.visible;
this.getField('rptInfo.9').value = 'Instruction seven';
this.getField('rptInfo.9').display = display.visible
};
if (this.getField('cbGroup1.3').value == 'Off') {
this.getField('rptCategory').value = '';
this.getField('rptInfo.1').value = '';
this.getField('rptInfo.1').display = display.hidden;
this.getField('rptInfo.2').value = '';
this.getField('rptInfo.2').display = display.hidden;
this.getField('rptInfo.3').value = '';
this.getField('rptInfo.3').display = display.hidden;
this.getField('rptInfo.4').value = '';
this.getField('rptInfo.4').display = display.hidden;
this.getField('rptInfo.5').value = '';
this.getField('rptInfo.5').display = display.hidden;
this.getField('rptInfo.6').value = '';
this.getField('rptInfo.6').display = display.hidden;
this.getField('rptInfo.7').value = '';
this.getField('rptInfo.7').display = display.hidden;
this.getField('rptInfo.8').value = '';
this.getField('rptInfo.8').display = display.hidden;
this.getField('rptInfo.9').value = '';
this.getField('rptInfo.9').display = display.hidden;
this.getField('rptInfo.10').value = '';
this.getField('rptInfo.10').display = display.hidden;
this.getField('rptInfo.11').value = '';
this.getField('rptInfo.11').display = display.hidden
};
}
With the above I would need over a 1000 lines of code to run this...Is there a better way to do this?
