How can I allow pre-programmed text to be user editable?
Hi All,
I have a document where I've added JavaScript to a dropdown which populates text to an associated textbox. This works perfectly, HOWEVER, I need for the user to ba able to edit the pre-programmed text. The text can be edited, but when anything else is done on the form (i.e. another programmed dropdown is selected, an image is imported, etc.), the edited text refreshes to the original pre-programmed text.
I'm using Acrobat Pro DC (2015). The JavaScript is in the Custom Calculation box of the dropdown box. The text appears in a textbox.
Here is a sample of the code:
var dropdownValue1 = this.getField("InspectionText0").value;
switch(dropdownValue1) {
case 1:
this.getField("inspection_image_text.0").value = "Roof leaks are probably the single most common roofing problems plaguing most homeowners. The leaks could be a result of many roof issues, such as broken shingles.";
break;
case 2:
this.getField("inspection_image_text.0").value = "Your roof has a reduced life expectancy. Living in an area where your roof is continuously exposed to ice and snow. When ice melts, it doesn’t run off fast enough since it melts at a slow rate. This can pass as stagnant water which penetrates underneath the roof and causes issues.. Even worse, during cold weather, the water that gets underneath can also freeze when temperatures drop.. When water freezes, it expands and pushes against the shingles, which leaves an opening that lets even more water in.";
break;
case 3:
this.getField("inspection_image_text.0").value = "If the sealant attaching your shingles wears off, it tends to loosen and break or come off completely. The sealant may be damaged by force of nature, rodents, or wear and tear. Depending on the age of your roof, shingles may start tearing off, which should be expected.";
break;
default:
this.getField("inspection_image_text.0").value = "";
break;
}
