Don't want zero dollar value

Ask a Question related to Adobe Acrobat Macintosh, Design and Development.

  1. #1

    Default Don't want zero dollar value

    Hi all,

    I set up an invoice form to calculate totals from quantity x unit price. Every line has this formula, however the users may not have a priced item on every line of the form. My total column shows a $0.00 value until I input data. I'd rather have nothing show in that column unless quantity and price are entered. Is that possible?

    Thanks!

    Elliott
    Elliott_Steinberg@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. CodeHints and dollar sign ($) problem
      Hi for everyone, I?m developing a extension to add CodeHints to the freeDOM.js (it?s a brazilian DOM Library) and I?m having problens when I use...
    2. Is it best to use Currency or Number for dollar values?
      I have been using Currency as the data type of choice for allowing clients to update dollar values (rate, fee, price) into an MS Access database. It...
    3. Dollar sign not displaying with cfchartlabelformat=currency
      Environment: ColdFusion MX 6.1 (6,1,0,83762) on JRun 4 w/ Updater 4 Solaris 9 Sun Java version 1.4.2-b28 (default installed version w/ CFMX and...
    4. [OT] History of the dollar sign [Was: [OT] Aesthetics of @ and $;]
      Alex, Interesting. I have never heard it suggested that the Malatesta "logo" was the inspiration for the dollar sign. Do you have any...
    5. A free dollar sign shape for ps6?
      Hello, I've looked on the net and in the adobe expert center looking for a free dollar sign shape for ps6 and can't find any that work for ps6. ...
  3. #2

    Default Re: Don't want zero dollar value

    Oh, I'm using Acrobat 8.11 on an Intel with OS 10.5.4 (just upgraded yesterday).
    Elliott_Steinberg@adobeforums.com Guest

  4. #3

    Default Re: Don't want zero dollar value

    What you need to do is use a custom Format and Keystroke JavaScript for the calculated field. Add the two following functions to a document JavaScript that you create:

    function ds_format() {

    if (+event.value) {
    // $ format for nonzero values
    AFNumber_Format(2, 0, 0, 0, "$", true);
    } else {
    // Don't show anything if result is zero
    event.value = "";
    }

    }

    function ds_keystroke() {

    AFNumber_Keystroke(2, 0, 0, 0, "$", true);

    }

    Then, place the following as the field's custom Format and Keystroke scripts, respectively:

    // Custom Format script
    ds_format();

    // Custom Keystroke script
    ds_keystroke();

    You can now use this for any other fields you want to do this for. Note that the Keystroke script isn't really necessary since you're dealing with a calculated field, which should be set to read-only, but I included it here for completeness in case you want to do this for a data entry field.

    George
    George_Johnson@adobeforums.com Guest

  5. #4

    Default Re: Don't want zero dollar value

    many thanks, but the only places I see to put non-canned scripts in "Text Field Properties/Calculate" are 2 boxes called "Simplified Field Notation" and "Custom Calculation Script." Do they all go in the latter one?

    Sorry, I'm a newbie at doing forms in Acrobat.

    Elliott
    Elliott_Steinberg@adobeforums.com Guest

  6. #5

    Default Re: Don't want zero dollar value

    For the document-level scripts, you access them via a menu item. I'm using version 6 on the machine I'm typing on at the moment, and the menu item is "Advanced > JavaScript > Document JavaScripts".

    For the field level scripts, select the Format tab of the Field Properties dialog, and select "Custom" from the drop-down list. You should then see where you can enter a Format and Keystroke script.

    Be sure to create the document-level script before setting up the Format/Keystroke scripts.

    George
    George_Johnson@adobeforums.com Guest

  7. #6

    Default Re: Don't want zero dollar value

    Mine's in "Advanced/Document Processing/Document Javascripts" but that option is greyed out. Any idea what I have to do to activate that?
    Elliott_Steinberg@adobeforums.com Guest

  8. #7

    Default Re: Don't want zero dollar value

    Never mind. It was because I had already put Usage Rights in place. I'll give your script a try. Thanks!
    Elliott_Steinberg@adobeforums.com Guest

  9. #8

    Default Re: Don't want zero dollar value

    Works well. Many thanks!

    Elliott
    Elliott_Steinberg@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139