6 Replies Latest reply on Nov 20, 2008 1:55 PM by Patrick Leckey

    Custom Borders using Javascript

      I need to make custom borders for all of my fields. I need to make a border on both the left and right, but not the top. I need the same border style for each field. The only way I know how to do this is to use javascript, but I not sure how to get it to work in Acrobat. I am pretty new with javascript, so any help would be appreciated.

        • 1. Re: Custom Borders using Javascript
          gkaiseril MVP & Adobe Community Professional
          Are you using Acrobat Forms Tool or LiveCycle Desinger to create the form?

          In LiveCycle Designer one can use the "Border" Window, Shift + F8. If you want to use either FormCalc or JavaScript in LiveCycle Designer, have you looked at "Changing the visual properties of an object on the client" in the "scripting Reference" in LiveCycle Designer.

          if (CheckBox14.rawValue == true)
          xfa.resolveNode("TextField.ui.#textEdit.border.edge").stroke = "solid";
          xfa.resolveNode("TextField.ui.#textEdit.border.edge").stroke = "lowered
          • 2. Re: Custom Borders using Javascript
            Level 1
            Is there any way that it can be done in Acrobat? This form needs to be used by other people in my department. Most of them know how to use how to use Acrobat, but LifeCycle is a little above their heads. Plus, I have the form already created, and it doesn't seem to be letting me change the Borders - it comes up with "borders cannot be used in forms with PDF backgrounds.
            • 3. Re: Custom Borders using Javascript
              Bernd Alheit Adobe Community Professional & MVP
              > Is there any way that it can be done in Acrobat?

              Not possible with forms created in Acrobat.
              • 4. Re: Custom Borders using Javascript
                George_Johnson MVP & Adobe Community Professional
                If I had to do this with Acrobat, I would create the border appearances in the source document and place the fields (with no borders) in the appropriate locations. I do this frequently for check boxes.

                • 5. Re: Custom Borders using Javascript
                  Level 1
                  Well, I thougth I knew how to use Acrobat, but I guess I don't. I have tried many ways to write the script for the borders, but with no luck. I would appreciate any push in the right direction that you are willing to give.

                  I am working with Acrobat 8.1.3. I have about 150 text fields that I would like all to have a thin red border on only the left and right sides (none on the top or bottom. Every one of the text fields on the page need this border, except one, the title.

                  Thanks everyone for all your help!
                  • 6. Re: Custom Borders using Javascript
                    Patrick Leckey Level 3
                    > none on the top or bottom

                    That's the problem - you can't set individual border sides in Acrobat JS like you can in HTML or CSS. You can set a borderStyle, but you can't tell it to only have a left or right border - the borderStyle affects all 4 sides.

                    Geo's suggestion is the way to go. Put your thin red line borders on the right and left of each field as just lines, and then set the fields to have no border. End result will look the same.