Complicated Populating Check Boxes and Text Boxes
Ok so I have a situation where I have Checkboxes and textboxes that are related and need to populate together to a single textbox BUT I have another set of checkboxes and textboxes that are related that ALSO need to populate together to the SAME single textbox mentioned previously. So here are the separate java scripts for each set of data that I want to put into the same single text box. How do I join the scripts together? or is it possible?
Script 1:
var values = [];
for (var i=280; i<=281; i++) {
var fname = "CheckBox "+i;
var f = this.getField(fname);
if (f==null) {
console.println("Error! Can't find: " + fname);
continue;
}
if (f.valueAsString!="Off") values.push(f.valueAsString);
}
if (this.getField("SLS EO").valueAsString!="") values.push("SLS EO: " + this.getField("SLS EO").valueAsString);
if (this.getField("SLS EC").valueAsString!="") values.push("SLS EC: " + this.getField("SLS EC").valueAsString);
event.value = values.join(", ");
Script 2:
var values = [];
for (var i=282; i<=283; i++) {
var fname = "CheckBox "+i;
var f = this.getField(fname);
if (f==null) {
console.println("Error! Can't find: " + fname);
continue;
}
if (f.valueAsString!="Off") values.push(f.valueAsString);
}
if (this.getField("WS Time").valueAsString!="") values.push("WS Time: " + this.getField("WS Time").valueAsString);
event.value = values.join(", ");
