Copy link to clipboard
Copied
Hi all,
I am entirely new to working with Adobe Acrobat Pro DC, actually, I'm new to working with Adobe period. I've also taken on the task at work to turn a bunch of Word documents into fillable pdf documents. Through online tutorials, trial & error, and YouTube videos, I have become accustomed to some of the basics in preparing and editing pdf documents.
What I am finding far more challenging is where to locate tutorials on how one adds java script commands to a form. Is there somewhere I can learn how to add JavaScript to, say, a radio button? I can locate the 'Run a JavaScript' on the Radio Button Properties Action tab but beyond that, there is not much out there.
My ultimate desire is to be able to have a line of text auto insert into a text box (APC Results) after radio button (WI_0) is selected. If someone could write the code for this, it would be much appreciated but above that, I would love to learn how JavaScript is used within a form.
Thank you for your time,
BobbyD
OK, in that case you can use the MouseUp event of the radio-button fields with this code:
if (event.target.value=="in spec") this.getField("APC Results").value = "See attached results";
Copy link to clipboard
Copied
If that radio-button is not selected, should the text field be editable by the user? If not, then you can simply use the custom calculation script of the text field. You just check the value of the radio-button group and apply the desired value to event.value ...
Copy link to clipboard
Copied
Hi try67,
Unfortunately I didn't mention that the text field needs to remain editable. I have two radio buttons in one group. If the 'in spec' radio button is selected, I'd like a text box to autofill with 'see attached results' and if the 'out of spec' radio button is selected, then specific results need to be entered into that same text box.
Copy link to clipboard
Copied
OK, in that case you can use the MouseUp event of the radio-button fields with this code:
if (event.target.value=="in spec") this.getField("APC Results").value = "See attached results";
Copy link to clipboard
Copied
Thank you try67.
That worked swimmingly. All I had to do then, was add this to the out of spec radio button:
if (event.target.value=="Out of Spec") this.getField("APC Result").value = "";
Then I can manually place the out of spec results into that field.
Thank you again,
Bob
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more