using check boxes value to populate text field

baddestdude 01-03-2016

I am new to javascipt programming. I am trying to use the value of checkboxes to populate a text box with text. there are three text boxes for each question labeled "Yes" "No" and "N/A".

If the technician selects "NO', then the text box is populated with the text associated with that question. If user changes to "YES" or "N/A", then the text related to that question is removed.

I have tried various statements, but the results are unacceptable.

I made this work in Adobe Acrobat Professional for the same type of form, but have been unable to make work in Lifecycle. This needs to work in Lifecycle due to use of expanding tables in the form.

Sample of text for Acrobat below.

var o = this.getField("txtDISC");

o.value = "";

var f = this.getField("CB1");

if(f.isBoxChecked(1)) o.value = o.value + "#1 DEFICIENCY: 25:Table 7.2.2.4 Dry Barrel and Wall Hydrants - Inaccessible - Make accessible.\n \n";

var f = this.getField("CB2");

if(f.isBoxChecked(1)) o.value = o.value + "#2 DEFICIENCY: 24:7.1.1.1 A valve shall be installed in the hydrant connection. 7.1.1.1.1 Valves in the hydrant connection shall be installed within 20 ft (6.1 m) of the hydrant.\n \n";

var f = this.getField("CB3");

if(f.isBoxChecked(1)) o.value = o.value + "#3 DEFICIENCY: 25:Table 7.2.2.4  Dry Barrel and Wall Hydrants - Leaks in outlets or at top of hydrant - Repair or replace gaskets, packing, or parts as necessary.\n \n";

var f = this.getField("CB4");

if(f.isBoxChecked(1)) o.value = o.value + "#4 DEFICIENCY: Hydrant caps shall be slightly more than hand tight per manufacturer instructions.\n \n";

Please assist me if possible

Thank you

Vince

Accepted Solutions (0)

Answers (0)