5 Replies Latest reply on Oct 13, 2010 1:56 PM by Josh68

    Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)

    canucksgirl

      I know this might be an easy question for people with javascript knowledge.... but I can't get this working... please help!

       

      I need Order Form total field (sum) to default to blank (instead of $0.00).

       

      *example: Under >calculate I am using "simplified field notation" and (Qty1)*7.95 -- sum appears in "total 1"

       

           The unit price is $7.95 - The value of Qty1 = total 1 (calculations are working fine)

       

           Currently all total boxes read as $0.00 --- I need SUM to be blank until a customer selects a quantity

       

      How can I make the SUM default to blank? and NOT $0.00 - Is it a validation script??? If so, please help with code!!!

       

      Help is appreciated - Thanks!

       

      PS - SUM fields can't be set as non-printing, because Shipping Dept./Accounting Dept. needs ability to print and view totals (if amount is selected - otherwise it could be blank).

       

      *** SUM fields need to be blank for customers who print form and manually enter data & totals...

       

      I am using a Mac, and Adobe Acrobat 9 Pro

        • 1. Re: Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)
          gkaiseril MVP & Adobe Community Professional

          Not that easy, it took awhile to realize that one could change a fields value as part of the field's validation process.

           

          I have found you can use the following code in the "Custom Validation Script" on the 'Validation" tab:

           

          // null filed value if entry is zero

          if(event.value == 0) event.value = "";

           

          You can use this script for all you calculation fields no matter which calculation option is chosen .

           

          This code will only execute once a field has been updated by a data entry or calculation event. So once you add the code, you may need to clear the form or enter data into a field that is used in a calculation and force the form to recalculate.

          1 person found this helpful
          • 2. Re: Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)
            canucksgirl Level 1

            I appreciate the reply... (it's been many hours without one)

             

            I tried the validation script, and as you indicated, the only way the total field (with the validation script) appears blank is AFTER the Reset button is clicked. (However I have not checked this in a reader)

             

            I can't see how I can make it work in that manner. Customer inputs Billing & Delivery Addresses at top, then proceeds to select products. If the reset button has to be pressed, all the data (ie. addresses) are removed.

             

            If there was a way to apply the reset function automatically at the opening of the pdf doc. then it would achieve the result I need. I wonder if there isn't a way with a check box at the top that customer clicks which would apply the reset function.

             

            If you (or anyone) has any further tips or help I would appreciate it. This is the last item the client has requested for change.

             

            PS. In case anyone can think of a print script to use... The sum value, when =0 (no qty) needs to print blank sum fields (not $0.00) BUT if there is a sum value, the amount must print (for Ship/Acct Depts)

             

            *** I just thought of something... The only time where the sum value needs to be blank is when customer prints and inputs data by hand.... so, would there be a way to add a print button that can also clear the sum values at the same time with the "reset" function and the validation script???

            • 3. Re: Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)
              gkaiseril MVP & Adobe Community Professional

              The issue is that many add the validation script and expect it to work as soon as the JavaScript editor is closed, much like a calculation script. But since the value of the form field has not changed, none of the various action scripts will trigger. And if one exits the field, only the "On Blur" action will be triggered. The validation script will only  run when the field in which it is located has its value changed. And for a read only calculated field, that will usually be by a calculation event or the form is reset. This script will even work if values used in a calculation's result results in a zero result for the field.

               

              You would have to add additional conditional testing if you want a zero value to appear if the result of the calculation is zero.

              • 4. Re: Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)
                canucksgirl Level 1

                I had to leave this for awhile, but I've come back to update and Thank you for your earlier help.

                 

                Although we discussed the script only working after "reset" or as you suggested, a calculation; I in fact found that after simply opening the pdf in Acrobat Reader 9 (vs. Acrobat 9 Pro) - the form sum totals that I added the Validation Script to were blank.

                 

                Initially, in Pro, the only way it would work was with the reset function, (there was no change when values were given to the validated sums or the unedited sums - regardless of what I did).

                 

                As frustrating as it is, the "preview" mode in Acrobat 9 Pro does not give a true indication of how the pdf doc will appear or function in Acrobat Reader 9. (This may also be true with older version as I have seen similar questions with regards to compatibility of functions between editors and readers.)

                 

                Most Important though, the Validation Script does work in Acrobat Reader 9 (which is where it is actually needed). So a big thank you for your help (even though you were not aware that it works unconditionally in the Reader.)

                • 5. Re: Acrobat 9 Pro: Order Form, need SUM=blank? and not $0.00 (HELP!!!)
                  Josh68

                  I just had this same question. You need custom javascript. Here's my solution, based on someone else's:

                   

                  http://forums.adobe.com/message/3205780