Changing Global Variables using Javascript | Community
Skip to main content
Niall_O_Donovan
Level 10
June 28, 2009
Question

Changing Global Variables using Javascript

  • June 28, 2009
  • 13 replies
  • 22951 views

Hi,

I have a project where I need to have lots of signature fields on a single form. I don't want to use a signatureField because this will increase the file size every time a signatureField is signed. Also client does not want digital signatures.

I set up three user variables (for both usernames and passwords), using Form/Properties/Variables.

I then set up a dialogue box on the click event of a button, which requests the username and password. If these match the global variables, then the associated textField is populated with the user's credentials. I got this to work OK.

The problems stated when I gave the user the ability to change their password. This would be an important, as the form would not need to come back to me to hardwire in the new password.

One of the global variables is "Pass1".The following script changed the value of the variable, but would not hold the change when the form was reopened:

     Pass1.value = AHSC02.strnewP;

".value" shouldn't work, but it did???

So I tried different versions of ".rawValue", but with no sucess:

     Pass1.rawValue = AHSC02.strnewP;

     form1.Pass1.rawValue = AHSC02.strnewP;

     form1.variables.Pass1.rawValue = AHSC02.strnewP;

Using ".rawValue" wouldn't change the password variable at all, even in the same session.

Source image file 175 not available

I would be very grateful if anyone had an idea as to how to change the global variable using Javascript, which will hold when the file is saved and reopened.

".value" works within the session, but doesn't hold the value on reopenning.

I am attaching a sample form, with three signing buttons/fields.

Username1 = Niall O'Donovan     Password = nod

Username2 = Marianne Barry     Password = mb

I have initially set up the "Niall O'Donovan" account with .rawValue and the "Marianne Barry" account with .value scripting.

I am wondering if this is considered a security issue by Adobe and therefore we are restricted from changing global variables using Javascript???

Thanks,

Niall

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

13 replies

Level 6
July 23, 2012

Jono,

Thanks for info you provided.  Are the generated invoice numbers coming out as 12 digits long on your end?

Jono_Moore
Level 10
July 23, 2012

It gives me a 10 digit number.

Level 2
July 9, 2018

Hi Niall

Sorry for digging an old thread.

could you please share the 2009 evolved file in dropbox or somewhere else other than acrobat. I am also trying to do similar time of form for my organisation.

thanks