Question about doing math in pdf form

Hi, I have created a filable form in adobe. I am trying to perform some basic math in this pdf form but I can't seem to get it to work. I have few fields that I am using basic logic to calculate one field. I used the following code.
if (Dropdown4> 0){
KWH = Dropdown3 * Dropdown4 * KWH1;}
else
{KWH = Dropdown3*Dropdown4*Dropdown1;}
endif
KWH1 is a fillable field but dropdown1, dropdown 3 and dropdown 4 are fields with drop down lists. I want to populate field KWH based on the logic above. I don't get any result whatsoever. The KWH field is blank.

The custom calculate script for the KWH field would be something like:
// Get the value of the fields, as numbers
var DD1 = +getField("Dropdown1").value;
var DD4 = +getField("Dropdown4").value;
var DD3 = +getField("Dropdown3").value;
var KWH1 = +getField("KWH1").value;
// Set this field's value
event.value = DD4 > 0 ? DD3 * DD4 * KW1 : DD3 * DD4 * DD1;
That last line is equivalent to:
if (DD4 > 0) {
    event.value = DD3 * DD4 * KW1;
} else {
   event.value = DD3 * DD4 * DD1;
There are a number of tutorials available if you want to learn more about creating custom calculation scripts in PDF forms. Post again if you need help finding them.

Similar Messages

  • Question about using calculations in PDF form

    I am creating an order form with fields using simple calcuation math (price field x qty field = subtotal field). My question is, if the quantity fields in the order form are blank I would like the subtotal and total fields to remain blank as well. However it shows and prints as 0.00. Is there a way to change that?

    Use this code as the custom validation script for that field:
    if (event.value == 0) event.value = "";

  • Question about using constant variables in Forms

    As I am still very new to Forms, please forgive my ignorance if the answer to my question is very simple. I am trying to figure out how to use constant variables within my Forms application. For example, if I want to setup return code constants for the application (mind me, these are examples):
    RC_SUCCESS CONSTANT PLS_INTEGER := 1;
    RC_FAILURE CONSTANT PLS_INTEGER := 0;
    RC_YEAR_DATA_NOT_FOUND := 50;
    Then in a module I created, if I wanted to check the return code against one of the constants I would do:
    DECLARE
    rc PLS_INTEGER;
    BEGIN
    GET_YEAR_DATA('2000', rc);
    IF rc = RC_YEAR_DATA_NOT_FOUND THEN
    -- Do some error handling
    END IF;
    END;
    I know that you can declare constants within individual procedures or packages but I can't see to find information on how to do this globally for the application. I've read about using global variables within Forms but the CHAR data type only and the fact the value can be changed doesn't really fit for this purpose. Am I missing something? Is there a config file or something for the webserver that can be used to set these up??
    Any help would be appreciated.
    Thanks

    To declare constants create a Package-Specification in a pll and deifne all your constants there, something like:
    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;Then attach that pll to all your forms-modules, and use it like
    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
    END IF;A word about exceptions or errors: In my eyes its clearer (and in case of exceptions even better) to raise an exception than to hide it behind return-codes.

  • Question about data extraction from web forms

    I am developing a simple web form in DreamWeaver MX for
    increased accesibility for users who utilize screen reader
    software, as navigating PDF forms is still currently very difficult
    for most of the screen readers to navigate. I was wondering if
    there is a way to take an .asp webform that a user fills out and
    when they hit a print button it would extract the data from the
    form and open an Adobe PDF form and populate the data they entered
    into specific fields within the PDF form which would allow them to
    print an official copy of the form they used the web version to
    complete. Any insight into this possibility is greatly appreciated!
    Thanks,
    AU PSD

    Regex? Lots of indexOf? Parsing...

  • Question about using library items in forms

    After a long time I am again returning to this perpetual fountain of Dreamweaver knowledge.
    I am converting a site from AGL to DW. In AGL I used a separate template for the forms (there are over 10) and used "components" to create the different forms. Each form shared features with other forms but were not identical, all together 5 components. When I converted over to DW the 5 compnents were made into 5 "library items" but neither the form template or the library items work, by that I mean they do not update if I make a change.
    Hence I want to make 5 new library items to use in the forms my question is this: when I choose an item to put in the form like a text field or radio button I always get this window.
    Though I read the documentation I am still not really clear about the "style" option so I just choose "no label tag." What is this used for? Any examples of how it is used?
    Regarding "position" before or after the item, what is this all about? I have been choosing "after form item" but I don't really know what the difference is and what advantages or disadvantages acrue from these choices.
    Regarding "Access key" and "Tab index" I sort of have the idea of what it is about but an example of how they work in action would clear up any nebulosity.
    But my real puzzle is with the following which pops up at the end when I am inserting a form items.
    Since the library items are not separate forms in themselves I have NOT added the form tag because my reasoning is that when I make the new form templates it will have the requisite form tags. Am I correct in this line of thinking? Or do I have to add form tags every time I add form elements to a form? I really don't want to have to do the whole thing over again if I get it wrong. So if one of you kind souls could guide me in doing it right the first time I would really appreciate it.
    I am using a MBP, OS X 10.6.8, DW CS6
    BvL

    To declare constants create a Package-Specification in a pll and deifne all your constants there, something like:
    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;Then attach that pll to all your forms-modules, and use it like
    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
    END IF;A word about exceptions or errors: In my eyes its clearer (and in case of exceptions even better) to raise an exception than to hide it behind return-codes.

  • Question about scripts in repeatbel sub-form objects

    Hi,
      I am working on creating a form which has a sub-form that can be repeated as many times as the user wants to. There is an ‘Add’ button which creates an instance of the sub-form on the form, when clicked.
    On the sub-form I have 5 numeric fields say a1-a5 and 1 field say b1 which is the sum of all these 5 fields.
    On the Main form I have a 2 fields - say t1 and f1.
    The requirement is t1=f1+b1+(sub-form instance 2’s b1)+(sub-form instance 3’s b1)+ and so on …depending on as many sub-form instances there are that the user adds.
    I have created Actions using the Action Builder such that when any of a1 to a5 fields are exited, b1 will be updated with the sum of a1-a5. At the same time t1 will be updated with sum of f1 and b1.
    This works great for 1 instance of the sub-form. But when ‘Add’ is clicked and a second instance of the sub-form is added, then the script does not work as it did for the first instance of the sub-form. So for any instances of the sub-form added, when values are added to a1-a5 and the fields are existed, b1 does not get updated.
    How can I fix this?
    See attached form that I am creating for clarity.
    ‘Total Hours worked this week’ is the t1 I was talking about. See how it gets updated when values are entered in any of the hour fields. It works fine with the default instance of the T100/Strategic/Advantage Customer Information sub-form as well. But when I click on ‘Add Customer’ button to add another instance of the sub-form, it does not work as expected.
    Please let me know if it is still not clear and I can explain the issue.

    Vjay's solution works great! Essentially, take out all of your other programming on the individual fields, and hard script the field you want the sum to show on. By directly referencing the fields, Adobe is able to tell the difference between one instance and another and doesn't get them mixed up. (I have found for some of these dynamic functions, the Action Builder doesn't really work, so you need to code by hand)
    My only suggestion, would be to perhaps modify Vjay's code a little, and use Javascript instead of Formcalc. We have run into the problem where if a user is using the form from a webserver or something and hasn't actually been saved to the user PC, the Formcalc scripts won't run, only Javascript. But it all depends on how you are using your forms.
    Here is your line of code changed to Javascript, in case you want to make that change. (there's really not much difference at all)
    this.rawValue = sum(CustomerTimeBD.Row1.Cell1.rawValue + CustomerTimeBD.Row1.Cell2.rawValue + CustomerTimeBD.Row2.Cell1.rawValue + CustomerTimeBD.Row2.Cell2.rawValue + CustomerTimeBD.Row3.Cell1.rawValue + CustomerTimeBD.Row3.Cell2.rawValue + CustomerTimeBD.Row4.Cell1.rawValue + CustomerTimeBD.Row4.Cell2.rawValue + CustomerTimeBD.Row5.Cell1.rawValue);

  • Question about documenting process maps and form object properties

    Does the new version of Workbench have a tool that allows us to print a report showing the properties of the object used in a form template or process map? For example... showing all of the properties like fonts, size, patterns, defaults, whether or not a field is required, etc...? I am also checking to see if this capability has been added to Workbench for Process Maps?

    No it does not but there is a blog entry by John Briinkman that will analyze your form template and give you some of that information. Here is a link to the blog entry:
    http://blogs.adobe.com/formfeed/2011/05/updated-form-report-tool.html
    Paul

  • Question about using database links in Forms 10g

    I have a form that uses a database link for the "Query Data Source Name," i.e. it is set to some_view@some_db_link
    For some reason when I run a query using the DB link the query takes approximately 30 seconds. When I remove the link and go local the query takes about one second. Has anybody observed and addressed this issue before (without going local of course)?
    Thanks,
    Thomas

    Let me first say that it is never a good idea to use a db link in the data source. It is better to create a synonym in the database and use this as the data source. If the db link changes, you only have to do this in the database, without recompiling forms.
    create synonym some_view for some_view@some_db_link
    This may already solve your problem. If not, than see if the query is also slow in sqlplus. You may have a problem in your connection between the two databases.

  • Question about - doing quotation of SAP material

    Hello,
    I am interested in keeping up our rules, and I want to show with my  behavior a good example to others.
    So my question is:
    Am I allowed to  post a screenshot of a pichture from SAP training material.
    I will wirte down the correct quotation.
    Example: Discussion about cost elements, giving explanation and refer to SAP material.
    Picture with quotation
    SAP AC 410 Cost Center Accounting, year 2006, page 3-15
    thank you for your answer
    all the best Erwin

    You actually just posted the screenshot
    The The SCN Rules of Engagement
    actually say: Please do not copy others work without first gaining written permission from the originator.  This includes SAP help files and training materials.
    I have no problem with a single screenshot with a clear quote as shown above, but we always have to see it in context, this should not be seen as a clean bill of health.
    If the copyright holder still has an issue then he can alert the moderators.

  • Question about Break Columns on Tabular Form

    is it possible to have the following result on apex Tabular Form while doing Break Columns ??
    To place one blank line between departments, enter the following command:
    BREAK ON DEPARTMENT_ID SKIP 1
    Now rerun the query:
    DEPARTMENT_ID LAST_NAME                     SALARY
               20 Hartstein                      13000
               80 Russell                        14000
                  Partners                       13500
               90 King                           24000
                  Kochhar                        17000
                  De Haan                        17000
    6 rows selected.The result achieved was not as expected, the sample is hosted on https://apex.oracle.com/pls/apex/f?p=10037 demo/1234 please help
    Region Source :
    select DEPTNO, EMPNO, ENAME, JOB,MGR, HIREDATE, SAL,COMM
    from "#OWNER#"."EMP"Report Attributes :
    Break Columns - First Column

    LTaura wrote:
    what does the built-in tabular form and break functionality do ?The built-in tabular form wizard generates the tabular form report and ApplyMRU and ApplyMRD processes to handle the submitted form.
    The report renders the retrieved data values as HTML form controls to enable them to be edited by the user. The <tt>DEPTNO</tt> in from the first row in your query is rendered thus:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0001" autocomplete="off"&gt;and that in the second row as:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0002" autocomplete="off"&gt;Since these are not exactly the same (different <tt>id</tt> attributes), the built-in break formatting sees them as different values, so no report break is applied.
    However, even if this was not the case and the break was applied to give only 3 text items for the 3 <tt>DEPTNO</tt> values, the ApplyMRU and ApplyMRD processes expect a <tt>DEPTNO</tt> value to be submitted for each row, and would fail for the subordinate <tt>EMP</tt> rows where it was missing.

  • Firefox does not show pdf form

    Installed Firefox 12.0 - Sys iMac G5 OS10.6.8. When trying to open a pdf file only a blank shows up. Under preferences -> Applications -> Content Type I do not have the Preview.app Document (application/pdf) showing so I cannot choose Adobe Reader????? Please help. Thanks. BM

    Hello Bmac4426,
    it seems like there might be a problem with your current Adobe® Acrobat® Plug-in for Web Browsers (version 10.1.3). I have however found a support [https://support.mozilla.org/en-US/questions/925055#answer-325683 article] proposing a work-around for Mac OS X users. Let me know how it goes.

  • Question about doing an index

    I am doing a cookbook.  I want to do an index that lists all the pages where the word "Apple" appears.  The "Classroom in a Book" leaves me with the sickening impression that I am going to have to go through all 350 pages and mark every time Apple appears in order to get it into my index properly.  Is there a simple way to have InDesign find all the occurences of "Apple" (and "Bean" and Banana", etc.) without my having to individually mark each and every occurrence?
    Thanks for your assistance.

    ccoburn3 wrote:
    ... I am going to have to go through all 350 pages and mark every time Apple appears in order to get it into my index properly. 
    That is how a professional indexer would make the preliminary list. (And after generating this preliminary list, this hypothetical indexer goes over the list again and again, concatenating, merging, deleting, and moving items around. Otherwise it would be a simple word lookup list.)
    But aside from that:
    Is there a simple way to have InDesign find all the occurences of "Apple" (and "Bean" and Banana", etc.) without my having to individually mark each and every occurrence?
    There is a button "Add All" in that very same dialog you are using to "Add" a single entry. Guess what it does.

  • Question about doing application development against older versions of Access

    I'll be working on a MS Access 2007 application written by someone else, whose no longer here. I've no experience writing MS Access applications, however I've used MS Access several times through the years as a desktop database. Therefore I know it's possible
    to open an older Access database, say Access 2007, with a newer version of Access. You can bring up tables, query definitions, etc. and do normal database things in newer versions of Access against older .mdb's or .accdb's.
    What I don't know is if it is possible to also do development against older versions of Access. Can I have MS Access 2013 on my development PC, but open a MS Access 2007 database with the Access application in it, and do development? Or will Access 2013
    insist that I upgrade the older database file to Access 2013?
    Rod

    One can definitely open and use it with Access 2013 (note - we haven't gotten to 'develop' it yet.....)
    Generally an app written with the 2007 edition is going to be a .accdb file - but it is possible it is the older .mdb file format. 
    In development is your issue; the latest edition has newer features that the older edition can't possibly know about.  Nothing unique about Access on this point.  It just is.  So if you invoke any of those - then you'll lose your backward
    ability as a 2007 user won't be able to open it.
    I definitely have tried to open an app in 07 only to receive a 'not recognized' type error message - and moved that app over to my 13 machine where it opened fine....and was never able to find which feature unique to 13 was the culprit....
    So if you tread cautiously you can be okay - and while I think I know the features that differentiate the products, I still prefer to play it safe and do all development in the edition that is used.

  • Two questions about the logistics of PDF for review...

    Hi experts. I'd appreciate your thoughts on the RH feature "Create PDF for Review". I've come across a couple concerns...
    The instructions say that the source RH files shouldn't be edited/altered while a PDF document of the same material is out for review. This is understandable from a synchronizing perspective. But I'm wondering if any of you think it's a non-starter that the source material is locked. I often can't wait for people to return comments, even by a requested deadline, before making edits. This is my first foray into RH docs, and right now I'm more inclined to use cut-and-paste-in-emails to request and receive doc comments.
    For those of you who do use the feature, and use the shared PDF option, do you know of a service that will host the group-commentable PDFs? Adobe used to have a service for this, but it seems like it is no more. And our IT guy is super security conscious and is so far resistant to have a group-writable directory on one of our servers.
    Thanks in advance for your replies.
    Kurt Euler

    Thanks Jeff. Yes, I believe your right that FM12 no longer is sensitive to changed source code. RH11 (my version) displays a warning that that the source shouldn't be messed with during the review period.
    Hmmm, I'll have to look into the Dropbox or similar service. My sense is that supporting a file sharing service is something that the PDF review mechanism needs to be designed to support. I'll research this.
    Thx again.
    -Kurt

  • Information about javascript in pdf forms

    Hello folks. Could anybody tell me where i can find information about application javascript language in pdf forms? I've visited adobe.com and found a lot of pdf articles but they are really useless. I want to find about object model of pdf form, about frequent used operators.

    Hi Konstantin,
    I think this could help you:
    LiveCycle Designer Scripting Basics http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    Adobe XML Form Object Model Reference: http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf
    Michal

Maybe you are looking for

  • TABLE  for Opening & closing Balance of G/L

    Hi all, I would like to know the name of the TABLE from where i can get the closing balance of previous fiscal and the opening balance of this fiscal year.(As there is a mismatch between the c/f balance.) Thanks for your Patience & Time Regards SAP4M

  • IPod Nano Woes

    I have 3 iPod Nanos and an iPod Touch. One of the Nanos is not being recognized by iTunes on two different computers. The other three are working fine. When I connect the one that is not working to Windows XP, it is seen by Windows, but not by iTunes

  • Gradient boundary appears printed, but not on PDF?

    Hey guys! Hope you can help me out with this. I'm exporting a PDF from InDesign. The PDF looks fine, but when I print it it appears as if a gradient border has a stroke applied. In InDesign I've confirmed that the stroke is 0, but I'm still getting a

  • Embedding form into html page

    I have embedded my adobe form into my website html page using the correct pixel width but it previews larger and is blowing out my webpage size - any thoughts?

  • Add an MSSQL "Linked" Server Object as a Data Source in Sharepoint Designer

    This is a hard question to research as there are "Linked Data Sources" in SharePoint Designer.  NOT WHAT I'M TALKING ABOUT. :) In Microsoft SQL Server you can create Linked Databases.  I'd like to find a way to use a Linked Database as a Data Source