I have a PDF document that is essentially a form which gets emailed. I'm trying to add functionality to a button. I want that button to run a Javascript which would fill in the formfield "Notes" with predetermined text and with the value of certain form fields.
ie, I click the button and it adds the following to formfield "Notes": "Blah blah blah (contents of formfield called "name"). Blah blah. etc..."
I want the form and that field to still be editable and not flattened at that point.
It seems so simple but I can't find anything on it?
If I could accomplish that, I also would like it to insert more detailed text:
- If FormField "A" is Yes, insert text to formfield notes "blah blah blah"
- If FormField "A" is No, insert text to formfield notes "yada yada yah"
Update
- All end users are utilizing Adobe Acrobat Pro DC.
- Since posting I was able to get it to insert text, now I just want to get it to insert text conditionally. If A is yes, then insert X. If A is no, then insert Y, etc... But I have no idea how to do that.
this.getField("Agriculture Operation Notes").value = "Permission to conduct the On-Site Supercheck was granted by the proposed insured, " + this.getField("First Name").value + " " + this.getField("Last Name").value + ", on a " + this.getField("Inspection Type").value + " basis. \n\n\It was so cold outside. \n\n\This is just a demonstration of how we can use JavaScript to improve our reports.\n\n\";