6 Replies Latest reply on Aug 14, 2009 1:26 PM by Triel2006

    Help with Scripting forms when additional characters added

    Triel2006

      Hi,

       

      I am new to scripting in adobe professional, I thank anyone in advance for any advice or help they can give me.

       

      I am trying to use the calcuations within the forms that I am putting fields onto.  In the process I discovered that the program the forms are within are attaching a pipe and additional characters after the actual name that I have named them.  So, I am not able to use even the simple calculations within adobe to "sum" fields.   For example: I named the field "1_1Text" and this is what displays when you go into the calculations and pick the fields you want.  But the actual name is "1_1Text|1234567" so the calculations will not work.

       

      I take it then I need to use the advanced scripting but I am unsure of the format for a routine such as this.  I have a little knowledge of javascript but it has been awhile.  There must be a scan to find the pipe and then you should be able to chop off the extra characters since I will never know the characters the program adds on so then I can do calculations on these fields. Then you would have to put them into an array or something to save them?   Any help with a script or hints would surely be appreciated.

       

      Thanks!

        • 1. Re: Help with Scripting forms when additional characters added
          gkaiseril MVP & Adobe Community Professional

          >For example: I named the field "1_1Text" and this is what displays when you go into the calculations and pick the fields you want.  But the actual name is "1_1Text|1234567"  ...

           

          Please clarify, did you name the field ' 1_1Text as stated' or ' 1_1Text|1234567' as explained? 

           

          I think you are using the wrong naming convention for field names.

          • 2. Re: Help with Scripting forms when additional characters added
            Triel2006 Level 1

            >>Please clarify, did you name the field ' 1_1Text as stated' or ' 1_1Text|1234567' as explained?

             

             

            I named the field "1_1Text" as per the standards here.  BUT the program that runs these forms attaches additional characters onto the name I gave it.  So, the name ends up to be "1_1Text|1234567"  the program attaches the "|1234567" at the end of my name.  So I believe I could write scripts if I could strip off the extra string the program puts on the end.  At least I hope.

             

            Does this make sense?  Or still not clear?

            • 3. Re: Help with Scripting forms when additional characters added
              gkaiseril MVP & Adobe Community Professional

              After crreating forms in Acrobat for 14 years, I have never seen this in Acrobat or LiveCycle Designer when manually adding fields.

               

              Could explain more fully how you are creating your forms and what programs you are using from the creation of the base document to which program and how you are adding fields.

              • 4. Re: Help with Scripting forms when additional characters added
                Triel2006 Level 1

                Could explain more fully how you are creating your forms and what programs you are using from the creation of the base document to which program and how you are adding fields.

                 

                 

                I think you are misunderstanding me.   I use Adobe Acrobat Professional 6.0.  I can get the calculations to work correctly if I use the form as it is after creating it. 

                 

                But these forms are put into an SQL database and they get selected within a VB.net program or ASP.net program (both are used).  So these programs (VB.net or ASP.net) are adding the extra characters at the end, hence I do not know the names of the fields when the forms are being filled in.  So the calculations do not work with the "original names" that I created for the fields.

                 

                I just figured if I created a routine that looped through and chopped off the extra characters these programs put on the end I would be able to do the calcuations and they would work.  I believe there is a substring operation within javascript.

                • 5. Re: Help with Scripting forms when additional characters added
                  gkaiseril MVP & Adobe Community Professional

                  It looks like you VB, ASP, or SQL database is modifying the field names.

                  • 6. Re: Help with Scripting forms when additional characters added
                    Triel2006 Level 1

                    Right, that is what I said.  I wanted to find out if I could create a routine to strip off these extra characters within the custom calculation script before I did the calcuations or is this impossible?  If so, some help with the code would be appreciated.