Skip navigation
Currently Being Moderated

Javascript code disapear, but still works :s

Apr 18, 2012 8:17 AM

Tags: #javascript #listbox #acrobat-forms #code_lost #code_disapear

Hello,

 

I have some troubles with a PDF I'm working on.

 

A piece of JavaScript code I've add to hide or show a picture on the form, depending on the value of a field, has disapeared!

It's not the first time some code disapear (from the validate tab, most of the time...)

 

It was under the format tab of the field (a listbox field) and was usuing the event.changeEx property.

 

What surprises me even more is that it still works! the pictures keep changing when I change the value of the field. I'd like to change the code since sometime the pictures will go back to hidden status sometime, but, of course, I can't...

 

I tried to restart acrobat, restart the computer, try it from another computer, it's still the same!

I've tried to find the code by searching for the name of the pictures, it shows nothing either...

 

What can I do? Where is my code?

 

:s

 

 

workspace : win XP / Mac OS X

Acrobat pro 9.5

 
Replies
  • George Johnson
    9,224 posts
    Aug 11, 2002
    Currently Being Moderated
    Apr 18, 2012 10:43 AM   in reply to Xiarea

    This can happen if you use some of the built-in functions available in Acrobat/Reader. The solution is to place the code in a function in a document-level JavaScript and call it from the appropriate event. This has the additional advantage of other fields being able to use the same code, if needed.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points