4 Replies Latest reply on Jul 16, 2012 10:04 AM by evil8

    basic javascript use in acrobat 9 pro

    evil8

      I admit to being very rusty and not familar with the new software. I am getting no results and no errors on the following on my acrobat form -

       

      I have an invoice form I'm using as a template. I have the following fields:

       

      to

      company

      address

      csz

      phone

       

      I set up to to be a combo box with space for blank and two names (I have two more to add later).

      I want to autofill the other text fields, by picking the name in the "to" box.

       

      I was going to do this as a javascript function, but I can't figure out how to do this using acrobat pro 9. I was doing this a lot some time ago using acrobat 6 where it was tools -> forms -> javascript or something like that. Now I'm lost so I went to the "to" field and set it to run a javascript on Mouse up.

       

      var t = this.getField("to").value;

      var co = this.getField("company").value;

      var a = this.getField("address").value;

      var cs = this.getField("csz").value;

      var p = this.getField("phone").value;

       

      switch (t)

      {

        case("Tom Jone"):

           co == "ABC Company";

           a == "100 Main St, Suite 101";

           cs == "Anywhere, IA 12345";

            p == "123-234-3456";

        break;

       

      case("Jane Smith"):

          ...

      break;

       

      case(" "):

         ...

      break;

      }

       

      I've tried using a single = in the case statement and I've also tried switching from a mouse up event to an On Blur event. Nothing seems to be working. If anyone can give me a hand here that would be great. Thanks.