How to populate text box from another text box
OK so I hope I can explain this well enough because it won't let me insert a photo in there. I have a group of text boxes that are roughly like this:
| Header 1 | Header 2 | Header 3 | Header 4 |
|---|---|---|---|
| PROMIS | PROMIS1 | PROMIS2 | |
| DASS | DASS1 | DASS2 | DASS3 |
| HDI | HDI1 | ||
| UEFS | UEFS1 | ||
| LEFS | LEFS1 |
Each one of those text boxes is where a number score is typed in for the PROMIS, DASS, HDI, UEFS and LEFS tests. As of right now I have those texts box scores populating down to a another text box called "OATS" but when they populate down to the "OATS" text box it is just the numbers and you don't know which test the numbers correspond to. So what I need, if it's possible, is this:
if "PROMIS1" text box, if it has a score of "4" typed in it to populate down to the "OATS" text box as this "PROMIS Phys - 4"
if "PROMIS2" text box has score of "4" then it populates down to "OATS" text box as "PROMIS Mental - 4"
If "DASS1" text box has score of "4" then it populates down to "OATS" text box as "DASS Dep - 4"
If "DASS2" text box has score of "4" then is populates down to "OATS" text box as "DASS Anx - 4"
If "DASS3" text box has score of "4" then is populates down to "OATS" text box as "DASS Str - 4"
If "HDI1" text box has score of "4" then is populates down to "OATS" text box as "HDI - 4"
If "UEFS1" text box has score of "4" then is populates down to "OATS" text box as "UEFS - 4"
If "LEFS1" text box has score of "4" then is populates down to "OATS" text box as "LEFS - 4"
All of these also need to be separated by a comma once they are in the "OATS" textbox"
The current Java script in the "OATS" text box to just simply populate the numbers is:
// Get the field values, as strings
var s1 = getField("PROMIS1").valueAsString;
var s2 = getField("PROMIS2").valueAsString;
var s3 = getField("DASS1").valueAsString;
var s4 = getField("DASS2").valueAsString;
var s5 = getField("DASS3").valueAsString;
var s6 = getField("HDI1").valueAsString;
var s7 = getField("UEFS1").valueAsString;
var s8 = getField("LEFS1").valueAsString;
// Combine values, separated by a comma
event.value = s1 + "," + " " + s2 + "," + " " + s3 + "," + " " + s4 + "," + " " + s5 + "," + " " + s6 + "," + " " + s7 + "," + " " + s8;
If anyone can help it would be greatly appreciated!! Thank you in advance!!
