Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to add Java Script in Adobe DC pro

Guest
Oct 12, 2016 Oct 12, 2016

Hi all! I know this question has been asked to death by now but I was unable to find the answer. Any who, I'm trying to add a bloody script for a pre made form to make all Field mandatory and give it a pop up as well! Also how do I apply this to the form itself? I have Java enabled on Adobe DC pro.

I'm not sure if this right code

f = getField(event.target.name)

if (f.value.length == 0)

    {

    f.setFocus()

    //Optional Message - Comment out the next line to remove

    app.alert("This field is required. Please enter a value.")

    }

I got this from Adobe's Acrobat 8 developers tips, wondering if this also works in DC pro as well.  if this code is no good can someone post be the right code please and thank you.

Message was edited by: Steven Robertson

TOPICS
Acrobat SDK and JavaScript , Windows
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 12, 2016 Oct 12, 2016

Should work just fine in Acrobat DC.

Translate
Community Expert ,
Oct 12, 2016 Oct 12, 2016

Should work just fine in Acrobat DC.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 12, 2016 Oct 12, 2016

Okay, however how do I apply to said form? I'm in Java right now but have no clue how to apply it. I go into the PDF that on adobe 8 developer tips for this I can edit the form and I can see text field properties and there bar called Actions where you can add the script to. However when I go back to my form I don't see the action bar in text field properties, perhaps I don't have something enabled correctly on my form?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 12, 2016 Oct 12, 2016

What kind of script did the tutorial you found say it was?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 12, 2016 Oct 12, 2016
LATEST

I figured it out yay! I got it working.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines