Copy link to clipboard
Copied
So I have 2 sets of Javascript that work fine seperately to populate into my specified text box but I cannot figure out how to make them both populate to the same text box. Help please!!
Here is the 1st set of script:
// Get the field values, as strings
var s1 = "Temp: " + getField("Temp").valueAsString;
var s2 = "Rt BP: " + getField("BPright").valueAsString;
var s3 = "Lt BP: " + getField("BPleft").valueAsString;
var s4 = "Oxi: " + getField("Oxi").valueAsString;
var s5 = "Pulse: " + getField("Pulse").valueAsString;
var s6 = "Resp: " + getField("Resp").valueAsString;
var s7 = "Chest Exp: " + getField("Chest Exp").valueAsString;
// Combine values, separated by a semicolon
event.value = s1 + ";" + " " + s2 + ";" + " " + s3 + ";" + " " + s4 + ";" + " " + s5 + ";" + " " + s6 + ";" + " " + s7;
Here is the 2nd set:
var values = [];
for (var i=41; i<=46; 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("Vision Findings").valueAsString!="") values.push("Vis Find: " + this.getField("Vision Findings").valueAsString);
event.value = values.join(", ");
Copy link to clipboard
Copied
Want you the text of the second script after the text of the first script?
Copy link to clipboard
Copied
Yes please
Copy link to clipboard
Copied
At the end replace
event.value = values.join(", ");
with
event.value += " " + values.join(", ");