Help with PDF Javascript calculation involving checkboxes

Hello Everyone,
I have a PDF Form, and need help with a calculation.
For the sake of simplicity, Lets say I have 5 fields. FSA1 and FSA2 are checkboxes. TotalClaimed1 and TotalClaimed2 are text fields which allow only a numerical input.
The last box, FSA_Total, should add the value from TotalClaimed1 if FSA1 is checked, and it should also add the value from TotalClaimed2 if FSA2 is checked.
The code is malfunctioning, however. Something is causing it to add to the total every time the box is checked. Its almost like the checking off of the box is what causes the addition.
It seems like the code is being read as "When the box is checked, add the value to the total", so each time the box gets checked, it adds to the total again.
and it should be "IF the box is checked, add the value to the total" so if there is a value in the field, and the box is checked, that value is passed on to the total; and if the box is not checked, the value is ignored.
Can anyone spot what might be causing this? Code is below.
var claim1 = parseInt(this.getField('TotalClaimed1').value),
    claim2 = parseInt(this.getField('TotalClaimed2').value),
    fsabox = parseInt(this.getField('FSA_Total').value);
if (this.getField('FSA1').value == 'Yes') {
    fsabox += claim1;
if (this.getField('FSA2').value == 'Yes') {
    fsabox += claim2;
event.value = fsabox;
Thanks
Thisguy1234

This is a custom calculation script for FSA_Total, correct? The code is working correctly, it's just not what you want. Assuming this is a custom calculation script in the FSA_Total field, it should be something like:
var sum = 0;
var claim1 = parseInt(getField('TotalClaimed1').value, 10),
    claim2 = parseInt(getField('TotalClaimed2').value, 10),
// Add field values if corresponding check boxes are selected
if (getField('FSA1').value !== "Off") {
    sum += claim1;
if (getField('FSA2').value !== "Off") {
    sum += claim2;
// Set this field value
event.value = sum;
Why are you using parseInt, exactly?

Similar Messages

  • Help with PDF Form Calculation

    OK So I don't know if this is even possible but what I am wanting is for clients to enter their income in the "income" felid and then for the "contribution" felid to pre-populate with how much they can have contributed...
    if the value is less than $31,920 then it is equal to $1000 – which works
    if the value is more than $61,920 then it is equal to $0 – which also works
    if the value is between $31,920 and $61,920 to apply the following formula:
    1000-(0.0333*(income-31920))  - this is where I am stumped!
    I have used the following code which works for the lesser than / greater than queries... however when I ask it to actually take the value in the box and use it to make a calculation I have no idea where to begin (or even if it is possible) so (as you can probably tell) I have just made up some sort of code which clearly doesn’t work...
    if (this.getField("income").value<31920) {
      event.value = 1000
      } else {
        if (this.getField("income").value>61920) {
        event.value = 0
      } else {
          event.value = 1000-(0.03333*((this.getFeild("income"))-31920))
    Any takers?

    You were very close. Try something like the following as the calculated field's custom Calculate script:
    (function () {
        // Get the field value
        var v = getField("income").value;
        if (v < 31920) {
            event.value = 1000;
            return;
        if (v > 61920) {
            event.value = 0;
            return;
        // v is >= 31920 and =< 61920
        event.value = 1000 - (0.03333 * (v - 31920));

  • Help with simple Javascript calculation please

    Hello, I've created a form for my company that contains measurements in meters for shipping.  I need to have the total of the measurement appear in the cube/M3 field.  For example, 6.17*3.02*3.35 returns NaN - it should return 62.42.  My fields are called Measure1Row and CubeM31Row.  This field will also be calculated as a total which I had no problem setting up. Under simplified field notation I entered = Measure1Row and it didn't work.  I also tried Measure1Row * 1.  Can someone please help me out?  Thanks so much!

    Hi George,
    I want the product of this measurement 6.17*3.02*3.35 (in meters) to appear in theCubeM31Row.  There are only 2 fields that are affected by this calculation - Measurement and Cube/M3.  The form fields are Qty, Commodity, Measurements, lbs, kgs and Cube/M31Row.  The measurement appears in one field - the other fields contain calculations that match and produce the correct answer.  Does that help?  I'm stumped.

  • [8i] Need help with some workday calculations

    At the beginning of the month, I got help with a workday calculation in: [8i] Help with function with parameters (for workday calculation)
    Now, as it turns out, I was able to locate a function in the database that does what I want, however, it is much slower to use the function than to join two copies of the CALN table (Please see referenced thread for details. I can copy them to this thread if necessary.) I need to verify that the pre-existing function has 'DETERMINISTIC' in it, as I would guess that if it doesn't, it would be much slower than it could be.
    But now, I've come across a situation where I have to do multiple workday calculations in the same query--enough that I have to join 6 copies of my CALN table. I can't imagine that is at all efficient. I believe it was Frank K. who said (in the original thread) that if the function was slow, I should consider alternatives. Can anyone help me identify some of those alternatives? I'm definitely at that point now. (This query is one I'm using as the base for a report in Oracle BI, and let's just say it doesn't like my query, even though my syntax appears to be correct, and I would guess that joining 6 copies of one table is at least partly to blame for this).
    Note: I'm working with Oracle 8i

    OK, I finally have some sample data... I tried to make it thorough. I've included data in the CALN table YTD + tomorrow, so that any workday calculations using SYSDATE will work.
    CREATE TABLE caln
    (     clndr_dt     DATE          NOT NULL
    ,     clndr_yr     NUMBER
    ,     shop_day     NUMBER
    ,     shop_dt          DATE
    ,     shop_wk          NUMBER
    ,     shop_yr          NUMBER
    ,     shop_days     NUMBER
    ,     clndr_days     NUMBER
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    INSERT INTO     caln
    VALUES (To_Date('12/23/2009','mm/dd/yyyy'),2009,247,To_Date('12/23/2009','mm/dd/yyyy'),51,2009,7631,10950);
    INSERT INTO     caln
    VALUES (To_Date('01/01/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10959);
    INSERT INTO     caln
    VALUES (To_Date('01/02/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10960);
    INSERT INTO     caln
    VALUES (To_Date('01/03/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),1,2010,7631,10961);
    INSERT INTO     caln
    VALUES (To_Date('01/04/2010','mm/dd/yyyy'),2010,1,To_Date('01/04/2010','mm/dd/yyyy'),1,2010,7632,10962);
    INSERT INTO     caln
    VALUES (To_Date('01/05/2010','mm/dd/yyyy'),2010,2,To_Date('01/05/2010','mm/dd/yyyy'),1,2010,7633,10963);
    INSERT INTO     caln
    VALUES (To_Date('01/06/2010','mm/dd/yyyy'),2010,3,To_Date('01/06/2010','mm/dd/yyyy'),1,2010,7634,10964);
    INSERT INTO     caln
    VALUES (To_Date('01/07/2010','mm/dd/yyyy'),2010,4,To_Date('01/07/2010','mm/dd/yyyy'),1,2010,7635,10965);
    INSERT INTO     caln
    VALUES (To_Date('01/08/2010','mm/dd/yyyy'),2010,5,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10966);
    INSERT INTO     caln
    VALUES (To_Date('01/09/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10967);
    INSERT INTO     caln
    VALUES (To_Date('01/10/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),2,2010,7636,10968);
    INSERT INTO     caln
    VALUES (To_Date('01/11/2010','mm/dd/yyyy'),2010,6,To_Date('01/11/2010','mm/dd/yyyy'),2,2010,7637,10969);
    INSERT INTO     caln
    VALUES (To_Date('01/12/2010','mm/dd/yyyy'),2010,7,To_Date('01/12/2010','mm/dd/yyyy'),2,2010,7638,10970);
    INSERT INTO     caln
    VALUES (To_Date('01/13/2010','mm/dd/yyyy'),2010,8,To_Date('01/13/2010','mm/dd/yyyy'),2,2010,7639,10971);
    INSERT INTO     caln
    VALUES (To_Date('01/14/2010','mm/dd/yyyy'),2010,9,To_Date('01/14/2010','mm/dd/yyyy'),2,2010,7640,10972);
    INSERT INTO     caln
    VALUES (To_Date('01/15/2010','mm/dd/yyyy'),2010,10,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10973);
    INSERT INTO     caln
    VALUES (To_Date('01/16/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10974);
    INSERT INTO     caln
    VALUES (To_Date('01/17/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),3,2010,7641,10975);
    INSERT INTO     caln
    VALUES (To_Date('01/18/2010','mm/dd/yyyy'),2010,11,To_Date('01/18/2010','mm/dd/yyyy'),3,2010,7642,10976);
    INSERT INTO     caln
    VALUES (To_Date('01/19/2010','mm/dd/yyyy'),2010,12,To_Date('01/19/2010','mm/dd/yyyy'),3,2010,7643,10977);
    INSERT INTO     caln
    VALUES (To_Date('01/20/2010','mm/dd/yyyy'),2010,13,To_Date('01/20/2010','mm/dd/yyyy'),3,2010,7644,10978);
    INSERT INTO     caln
    VALUES (To_Date('01/21/2010','mm/dd/yyyy'),2010,14,To_Date('01/21/2010','mm/dd/yyyy'),3,2010,7645,10979);
    INSERT INTO     caln
    VALUES (To_Date('01/22/2010','mm/dd/yyyy'),2010,15,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10980);
    INSERT INTO     caln
    VALUES (To_Date('01/23/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10981);
    INSERT INTO     caln
    VALUES (To_Date('01/24/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),4,2010,7646,10982);
    INSERT INTO     caln
    VALUES (To_Date('01/25/2010','mm/dd/yyyy'),2010,16,To_Date('01/25/2010','mm/dd/yyyy'),4,2010,7647,10983);
    INSERT INTO     caln
    VALUES (To_Date('01/26/2010','mm/dd/yyyy'),2010,17,To_Date('01/26/2010','mm/dd/yyyy'),4,2010,7648,10984);
    INSERT INTO     caln
    VALUES (To_Date('01/27/2010','mm/dd/yyyy'),2010,18,To_Date('01/27/2010','mm/dd/yyyy'),4,2010,7649,10985);
    INSERT INTO     caln
    VALUES (To_Date('01/28/2010','mm/dd/yyyy'),2010,19,To_Date('01/28/2010','mm/dd/yyyy'),4,2010,7650,10986);
    INSERT INTO     caln
    VALUES (To_Date('01/29/2010','mm/dd/yyyy'),2010,20,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10987);
    INSERT INTO     caln
    VALUES (To_Date('01/30/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10988);
    INSERT INTO     caln
    VALUES (To_Date('01/31/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),5,2010,7651,10989);
    INSERT INTO     caln
    VALUES (To_Date('02/01/2010','mm/dd/yyyy'),2010,21,To_Date('02/01/2010','mm/dd/yyyy'),5,2010,7652,10990);
    INSERT INTO     caln
    VALUES (To_Date('02/02/2010','mm/dd/yyyy'),2010,22,To_Date('02/02/2010','mm/dd/yyyy'),5,2010,7653,10991);
    INSERT INTO     caln
    VALUES (To_Date('02/03/2010','mm/dd/yyyy'),2010,23,To_Date('02/03/2010','mm/dd/yyyy'),5,2010,7654,10992);
    INSERT INTO     caln
    VALUES (To_Date('02/04/2010','mm/dd/yyyy'),2010,24,To_Date('02/04/2010','mm/dd/yyyy'),5,2010,7655,10993);
    INSERT INTO     caln
    VALUES (To_Date('02/05/2010','mm/dd/yyyy'),2010,25,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10994);
    INSERT INTO     caln
    VALUES (To_Date('02/06/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10995);
    INSERT INTO     caln
    VALUES (To_Date('02/07/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),6,2010,7656,10996);
    INSERT INTO     caln
    VALUES (To_Date('02/08/2010','mm/dd/yyyy'),2010,26,To_Date('02/08/2010','mm/dd/yyyy'),6,2010,7657,10997);
    INSERT INTO     caln
    VALUES (To_Date('02/09/2010','mm/dd/yyyy'),2010,27,To_Date('02/09/2010','mm/dd/yyyy'),6,2010,7658,10998);
    INSERT INTO     caln
    VALUES (To_Date('02/10/2010','mm/dd/yyyy'),2010,28,To_Date('02/10/2010','mm/dd/yyyy'),6,2010,7659,10999);
    INSERT INTO     caln
    VALUES (To_Date('02/11/2010','mm/dd/yyyy'),2010,29,To_Date('02/11/2010','mm/dd/yyyy'),6,2010,7660,11000);
    INSERT INTO     caln
    VALUES (To_Date('02/12/2010','mm/dd/yyyy'),2010,30,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11001);
    INSERT INTO     caln
    VALUES (To_Date('02/13/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11002);
    INSERT INTO     caln
    VALUES (To_Date('02/14/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),7,2010,7661,11003);
    INSERT INTO     caln
    VALUES (To_Date('02/15/2010','mm/dd/yyyy'),2010,31,To_Date('02/15/2010','mm/dd/yyyy'),7,2010,7662,11004);
    INSERT INTO     caln
    VALUES (To_Date('02/16/2010','mm/dd/yyyy'),2010,32,To_Date('02/16/2010','mm/dd/yyyy'),7,2010,7663,11005);
    INSERT INTO     caln
    VALUES (To_Date('02/17/2010','mm/dd/yyyy'),2010,33,To_Date('02/17/2010','mm/dd/yyyy'),7,2010,7664,11006);
    INSERT INTO     caln
    VALUES (To_Date('02/18/2010','mm/dd/yyyy'),2010,34,To_Date('02/18/2010','mm/dd/yyyy'),7,2010,7665,11007);
    INSERT INTO     caln
    VALUES (To_Date('02/19/2010','mm/dd/yyyy'),2010,35,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11008);
    INSERT INTO     caln
    VALUES (To_Date('02/20/2010','mm/dd/yyyy'),2010,0,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11009);
    CREATE TABLE ords
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     ord_stat     VARCHAR2(2)
    ,     ord_qty          NUMBER
    ,     part_nbr     VARCHAR2(5)
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr)
    INSERT INTO     ords
    VALUES (1,1,'CL',10,'PART1');
    INSERT INTO     ords
    VALUES (1,2,'CL',5,'PART1');
    INSERT INTO     ords
    VALUES (25,1,'CL',15,'PART2');
    INSERT INTO     ords
    VALUES (14,1,'OP',12,'PART3');
    INSERT INTO     ords
    VALUES (33,1,'CL',25,'PART1');
    INSERT INTO     ords
    VALUES (33,2,'CL',15,'PART1');
    INSERT INTO     ords
    VALUES (33,3,'OP',10,'PART1');
    INSERT INTO     ords
    VALUES (7,1,'PL',18,'PART2');
    INSERT INTO     ords
    VALUES (96,1,'PL',10,'PART3');
    INSERT INTO     ords
    VALUES (31,1,'CL',20,'PART2');
    CREATE TABLE oops
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     op_nbr          VARCHAR2(4)     NOT NULL
    ,     mach_id          VARCHAR2(4)
    ,     oper_stat     VARCHAR2(2)
    ,     plan_start_dt     DATE
    ,     plsu          NUMBER
    ,     plrn          NUMBER
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr, op_nbr)
    -- NOTE:
    -- for the orders with a status of 'CL' or 'PL' in the 'ords' table, I'm not bothering to put
    -- in more than two operations (though in reality more would be there) since they should be
    -- ignored in the final result anyway
    INSERT INTO     oops
    VALUES (1,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (1,2,'0010','123A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (25,1,'0005','123A','CP',TO_DATE('01/18/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (25,1,'0030','110C','CL',TO_DATE('01/19/2010','mm/dd/yyyy'),4,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0010','127A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0025','110C','CL',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0040','050C','CP',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.15);
    INSERT INTO     oops
    VALUES (14,1,'0050','220B','WK',TO_DATE('01/14/2010','mm/dd/yyyy'),4,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0065','242B','AV',TO_DATE('01/18/2010','mm/dd/yyyy'),1.5,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0067','150G','NA',TO_DATE('01/19/2010','mm/dd/yyyy'),2,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0100','250G','NA',TO_DATE('01/20/2010','mm/dd/yyyy'),2.1,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,2,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,3,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0020','220B','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1.7,0.15);
    INSERT INTO     oops
    VALUES (33,3,'0030','150G','NA',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.05);
    INSERT INTO     oops
    VALUES (33,3,'0055','150G','NA',TO_DATE('01/15/2010','mm/dd/yyyy'),2.1.,0.1);
    INSERT INTO     oops
    VALUES (7,1,'0005','123A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (7,1,'0030','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (96,1,'0010','127A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (96,1,'0025','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (31,1,'0005','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (31,1,'0030','110C','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    CREATE TABLE mach
    (     mach_id          VARCHAR2(4)     NOT NULL
    ,     desc_short     VARCHAR2(9)     
    ,     group          VARCHAR2(7)
         CONSTRAINT ords_pk PRIMARY KEY (mach_id)
    INSERT INTO     mach
    VALUES     ('123A','desc here','GROUPH1');
    INSERT INTO     mach
    VALUES     ('259B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('110C','desc here','GROUPJ1');
    INSERT INTO     mach
    VALUES     ('050C','desc here','GROUPK2');
    INSERT INTO     mach
    VALUES     ('220B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('150G','desc here','GROUPL1');
    INSERT INTO     mach
    VALUES     ('250G','desc here','GROUPL2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');

  • Help with pdf tasks

    Hello,
    I am trying to automate a couple of specific tasks with pdf files but I am having some trouble. At my job we are printing files to pdf but afterwards we must go back and edit the pdf files. Basically what we need to do is this (in order):
    1) Rotate the first 'one to three' pages. The first page(s) need to be rotated counterclockwise but it can be 1-3 pages that need this. All we know is that they always appear first. These pages are very similiar in content so I was thinking about making the program search for a keyword common to those pages then rotate it if it finds that keyword. That way we can ensure that its only rotating the pages which need to be rotated.
    2) The last 3 pages of the document need to be moved to the top. These documents vary in number of pages so I cant just tell the program to move certain pages numbers to the top. All we know is that its always the last 3 pages of any document that need to be moved to the top. Also, just for clarification is another way to reorder pages in Acrobat besides dragging them with the mouse?
    Any input would be greatly appreciated.
    Thanks
    Fazal

    Both of these could be implemented using JavaScript, perhaps using a batch sequence. #2 is easy, and #1 may or may not be possible/reliable based on the actual content of the document.
    For #1, a script is able to loop through the words on a page to search for one or more words. If found, it can look at the position of the word on the page, and if it meets the position criteria, use the setPageRotations document method to rotate the page.
    For #2, just use the movePage document method to move the last three pages.
    If you need help with the code, consider posting in the Acrobat Scripting forum. Include more information for #1 if you do.

  • Help with PDF Generation

    We are currently evaluating LiveCycle ES to potentially convert numerous Pro/E 3D drawings to PDF. Unfortunately, I am having a difficult time finding the proper resources to help achieve this. What we would like the process to do is:
    1) Take a Pro/E file, and apply a forms template
    2) Add an "Exploded View" animation for the 3D drawing (such as what can be generated by Adobe 3D Reviewer)
    3) Expose the "Bill of Material" to the template fields
    4) Save the generated PDF to a defined folder
    5) Perform these steps for a "watched folder" for when new drawings are submitted
    In LiveCycle Workbench, I have been able to read a Pro/E file and apply our template. But I cannot find information on how to achieve the other steps.
    Could somebody please point me to specific resources and/or samples that would help with this? Any help would be very appreciated.
    Thanks!

    Thanks for your reply.
    If I'm understanding you correctly, option 1 probably won't work for this situation, because we're working with existing ProE drawings -- hundreds, if not thousands, of them. So, they don't want to go back and add the exploded view. Unless you're saying that we could use javaScript to generate the exploded view and BOM from the ProE files?
    Do you know of an example (or other resource) that describes either of the options you outlined? Could you explain a little more?
    Thanks again!

  • Need help with a JavaScript to generate random number

    Hi
    First things first. I don't know the J of JavaScript.
    When I was thinking of some readymade solution to generate a random number in Captivate, I found this on a LinkedIn forum.
    1) Add a user variable to your project called "randomNumber". It's value can be zero.
    2) Add a Text Caption with "$$randomNumber$$" in it, to check whether your script is working.
    3) Add a button to the slide. Give it an On Success Action of Execute JavaScript. Turn off it's "Continue Playing the Project" checkbox.
    4) Add the following text in the button's Script_Window:
    var objCP = document.Captivate;
    var rand = 1 + Math.floor(Math.random() * 10);
    function onButtonClick(){
    objCP.cpEISetValue('randomNumber', rand);
    onButtonClick();
    However, this is (as the poster in the forum warned) not working for Captivate 7. Can somebody please help?
    I am open for any other methods of getting the same result.
    Thanks in advance,
    Sreekanth

    Hi Sreekanth,
    When testing, make sure you are testing from a web server where the web address begins with http or https.  When setting the captivate variable "randomNumber" try this instead:
    objCP.cpEISetValue('m_VarHandle.randomNumber', rand);
    That will only work for SWF output.  If you want it to work for both HTML5 and SWF output, try this code:
    window.onButtonClick = function(){
              var rand = generateRandomNumber(1, 10);
              setCpVariable('randomNumber', rand);
    window.generateRandomNumber = function(min, max){
              var randomNum = 0;
              if(!isNaN(parseFloat(min)) && !isNaN(parseFloat(max))){
                        min = Number(min);
                        max = Number(max);
                  randomNum = Math.floor(Math.random() * (max - min + 1)) + min;
              return randomNum;
    window.setCpVariable = function (cpUserVariableName, variableValue) {
              /* Check for HTML5 vs. SWF output */
              if (typeof window.cp === 'undefined') {
                        /* We have SWF output, so Get the Captivate Object */
                        var objCp = document.getElementById('Captivate');
                        if (objCp && objCp.cpEISetValue) {
                                  /* Set the Captivate User variable with the JavaScript variable, variableValue */
                                  objCp.cpEISetValue('m_VarHandle.' + cpUserVariableName, variableValue);
              } else {
                        /* We have HTML5 output */
                        /*If variable does not exist off of the window object, then use the variables manager*/
                        if (typeof window[cpUserVariableName] === 'undefined') {
                                  if (cp.vm && cp.vm.setVariableValue) {
                                            cp.vm.setVariableValue(cpUserVariableName, variableValue);
                        } else {
                                  window[cpUserVariableName] = variableValue;
    window.onButtonClick();
    Be sure to test this from a web server or else local security will prevent the javascript from executing.
    Best,
    Jim Leichliter

  • HELP WITH PDF TO WORD DOC

    pLEASE HELP WITH CONVERTING A PDF REPORT TO A WORD DOC WHERE i CAN MAKE CHANGES AND PRINT A NEW REPORT.

    Hi Christine,
    It looks like you have a subscription to our ExportPDF service. Follow the steps in our Getting Started Guide to convert your PDF to Word: http://forums.adobe.com/docs/DOC-2412
    You should be able to edit your file in Word after the conversion.
    -David

  • Need help with adjusting Javascript code to work in Adobe Edge (Countdown)

    Hello
    Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
    Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
    I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
    Thanks!
    Mvh,
    Øyvind Hermans

    Hello again
    I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
    Is this problem also occuring when you watch the animations?
    Is the countdown-code to much for the browsers to handle?
    Thanks in advance for your answers.
    Sincerely,
    Øyvind Hermans

  • Need help with PDF/X-1a

    I am beyond frustrated here so I hope someone can help me!!!! Ii have Adobe 8 Standard and I can't find the PDF/X-1a in my distiller. I need this particular preset to upload a book cover. The website won't accept any other format. The only thing I have in my distiller is PDF/A-1b.
    Does anyone know where I can get the correct distiller? Everyone I know with Adobe 8 has the PDF/X-1a in their options and they don't remember having to do anything special to get it.

    Assuming you have Acrobat installed, it would not hurt to verify compliance after the document is created. With the doc open (on my vesion 9) Advanced > Print Production > Preflight > PDF/X Compliance > Verify compliance with PDF/X-1a  hit analyze
    Note that a document must have a Title in the Title box under Document > Properties (ctrl+d) to pass X-1a and, for whatever reason, analyze and fix cannot add this.
    And I'm far from the resident expert here..

  • Please help with customizing price calculation in CRM 7 !!!

    Hi, Experts!
    I have a problem with customizing price calculation for product. Product is a bank's credit. I want to fill credit's data (percentage rate, pay term, monthly comission and other conditions) in condition record and after pricing procedure done i could saw results in WebUI (monthly fee, total rpice of product and etc.). 1) How to do that? Can i change or insert some fields (i mean columns) in product area (for example when i want to create opportunity)? 2) How can i change or insert calculation rule? 3) Can i insert formula in calsulation? Help me please step by step.
    Thank for your help.
    Regards,
    faraviper.

    Hello Faraviper
    I think you have not installed PME component correctly. Please use the following path to see the help documentation for that.
    http://service.sap.com/crm-inst
    or
    http://service.sap.com/instguides
    Also check out this OSS note, though it is for an older release it may throw some important pointers.
    857969 - Installing PME for CRM 5.0
    Hope this helps.

  • Need help with my graphic calculator!!!

    Hello everybody!! I need help with my little program I made.... The problem is that I am unable to use to calculate but it is possible to compile the code!! What should I do?? Thanks in advance.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Aritmetik extends JFrame implements ActionListener{
         private JLabel l1 = new JLabel("Tal1: ", JLabel.LEFT);
         private JLabel l2 = new JLabel("Tal2: ", JLabel.LEFT);
         private JLabel l3 = new JLabel("Resultat",JLabel.LEFT);
         private JLabel l4 = new JLabel(" ", JLabel.RIGHT);
         private JTextField t1 = new JTextField(" ",10);
         private JTextField t2 = new JTextField(" ",10);
         private JButton b1 = new JButton("+");
         private JButton b2 = new JButton("-");
         private JButton b3 = new JButton("*");
         private JButton b4 = new JButton("/");
         public Aritmetik(){
              Container v = getContentPane();
              v.setLayout(new GridLayout(5,2));
              v.add(l1);
              v.add(t1);
              v.add(l2);
              v.add(t2);
              v.add(b1);
              v.add(b2);
              v.add(b3);
              v.add(b4);
              v.add(l3);
              v.add(l4);
              b1.addActionListener(this);
              b2.addActionListener(this);
              b3.addActionListener(this);
              b4.addActionListener(this);
              pack();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
         public void actionPerformed(ActionEvent e){
              int tal1 = Integer.parseInt(t1.getText());
              int tal2 = Integer.parseInt(t2.getText());
                   if(e.getSource() == b1){
              if(t1.getText().equals("") || t2.getText().equals(""))
                                       JOptionPane.showMessageDialog(null, "Mata in tal!");
                   else{
                        l3.setText("Resultat ");
                   l4.setText(" " + (tal1+tal2));
                   else if(e.getSource() == b2){
                        int sub = tal1-tal2;
                        l4.setText(" " + (sub));
                   else if(e.getSource() == b3){
                        int multi = tal1*tal2;
                        l4.setText(" " + (multi));
                   else if(e.getSource() == b4){
                        int div = tal1/tal2;
                        l4.setText(" " + (div));
                   public static void main(String[] arg){
                   Aritmetik A =new Aritmetik();

    Here is your problem:
    public void actionPerformed(ActionEvent e){
      int tal1 = Integer.parseInt(t1.getText().trim());  // add the trim()
      int tal2 = Integer.parseInt(t2.getText().trim());  // add the trim()
      if(e.getSource() == b1){
        if(t1.getText().equals("") || t2.getText().equals(""))
          JOptionPane.showMessageDialog(null, "Mata in tal!");
        else{
          l3.setText("Resultat ");
          l4.setText(" " + (tal1+tal2));
      }... Better ...
    public void actionPerformed(ActionEvent e)  throws NumberFormatException {
      String tala = t1.getText().trim();
      String talb = t2.getText().trim();
      if ( tala == null  ||  "".equals(tala)  ||  talb == null  ||  "".equals(talb) ) {
        JOptionPane.showMessageDialog(null, "Mata in tal!");
        return();
      int tal1 = Integer.parseInt(tala);
      int tal2 = Integer.parseInt(talb);
      if(e.getSource() == b1){
        l3.setText("Resultat ");
        l4.setText(" " + (tal1+tal2));
      else if(e.getSource() == b2){
        int sub = tal1-tal2;
        l4.setText(" " + (sub));
      else if(e.getSource() == b3){
        int multi = tal1*tal2;
        l4.setText(" " + (multi));
      else if(e.getSource() == b4){
        int div = tal1/tal2;
        l4.setText(" " + (div));
    }Message was edited by:
    abillconsl

  • Help with PDF form responses

    Hey there!
    I have two issues with online form data collection and am completely stumped. It's a real struggle to find useful documentation for Acrobat forms!
    #1 - I have created a form uploaded it to Acrobat.com, and have been able to collect test form data. In the local responses portfolio, I'm able to use the 'Update' button to bring the latest form data into the portfolio. But I would like to have a colleague be responsible for monitoring the form data and we're running into problems. He's able to open the portfolio and has full access, however the 'Update' button is greyed out so he is unable to bring in new form data. We've already updated his 'Acrobat.com' username/password in Acrobat preferences to match mine, but still no luck. Any help?
    #2 - Some computers are having issues with electronic submission. My best guess is that this is to do with Acrobat versions, as the issues all seem to come from computers where the form is completed using Acrobat Reader 8. The form was created with Pro 9, and form submission works for both Pro 9 and also Reader 9. Is there something I can do here? (And yes I know that it's a free upgrade to 9, but 8 is still in the official build for our organisation and I don't really have time to wait for them to complete an upgrade!)
    Thanks in advance for any help you can give.
    Jarrod

    Hello Paul,
    Thank you for your reply.
    I use Ipower for my hosting.  I see they use sendmail and the path on the server is - /usr/sbin/sendmail.  Would this work?
    The way I would like this to work would be:
    1) I e-mail the PDF form to the client
    2) Client opens and fills in the form
    3) They hit submit and the form information eventually gets e-mailed to my business e-mail
    I chose to use the HTTP method instead of e-mail because the PDF form says it can not be saved and if the client uses an internet beased e-mail like Yahoo it gets kind of messy.
    But, does the HTTP delivery method make it more difficult since this is not embedded in a website?
    Sorry, I did not realise this would be as involved as it is.  Your help would be greatly appreciated.

  • Help with PDF Form Submission

    Hello,
    I am using Live Cycle for the first time.  I have designed a PDF form that my clients will fill out and then send back to me.
    I have a website and thought submitting the form via http would be best but am having a problem with knowing the correct URL an then the server authentication.
    When I try to submit now I get an authorization error.
    Here is the URL I used in LiveCycle - http://watchmymvp.com/profilesubmissions
    This is to a folder a created on the server.
    How do I set this up?
    Thanks

    Hello Paul,
    Thank you for your reply.
    I use Ipower for my hosting.  I see they use sendmail and the path on the server is - /usr/sbin/sendmail.  Would this work?
    The way I would like this to work would be:
    1) I e-mail the PDF form to the client
    2) Client opens and fills in the form
    3) They hit submit and the form information eventually gets e-mailed to my business e-mail
    I chose to use the HTTP method instead of e-mail because the PDF form says it can not be saved and if the client uses an internet beased e-mail like Yahoo it gets kind of messy.
    But, does the HTTP delivery method make it more difficult since this is not embedded in a website?
    Sorry, I did not realise this would be as involved as it is.  Your help would be greatly appreciated.

  • Need help with crazy custom calculations code in Acrobat XI pro

    Im trying to calculate some text feilds together and just cant figure it out.  I have two text feild boxes that I would input certain numbers to calculate in, Textfeild D5 and D6,  once the user supplies the numbers in the D5 and D6   I need a text feild (D9) to calculate and produce a number thats used in another calculation. Any help would be greatly appriciated. Im good at HTML and CSS but only begining with javascript. Im using acrobat XI pro and I put this code in the custom javascript area within the text feld "D9" properties.
    var Dsix = +getField("D6").value;
    var Dfive = +getFeild("D5").value;
    var B2 = 0.37;
    var B3 = 0.45;
    var B4 = 0.53;
    if (Dsix = 15){
    D9.value = B2*Dfive;
    if (Dsix = 30){
    D9.value = B3*Dfive;
    if (Dsix = 45){
    D9.value = B4*Dfive;

    Well thats makes since but unfortunitly it didnt work. The green text feild D9 is where im placing code at. they will be hiiden feilds. the red outlined text feilds are all input feilds. seconds is D6 and nozzels is D5.

Maybe you are looking for

  • Need help getting music off ipod

    I used to have 2 libraries on my itunes (mine & hubby's). Now it only shows hubby's music library - no classical. How do I get the missing music that is on my ipod back in the itunes library so I can sync my new ipod and get all the music?

  • Failure with mpeg2 dvd

    I'm rendering the same sequence of about an hour to different formats mostly hd 1080p h.264 and pal to mpeg2 dvd so encore wont work hard to convert. last days I cant get the mpeg 2 dvd to render, I keep getting errors/failure.if I render just mpeg2

  • Can we catch the error in java??

    can we catch/handle the error????if yes the how........

  • How to register apple protection plan

    Hi , I have Mac with me , recently I purchased Apple Care Protection Plan,I tried more than 5 times on line registration, not sucessfull , Why ?  I am getting two tick marks in green I am not getting the final one tick in green. Chandra

  • Text description beside the field in display screen

    Hello Gurus, I wrote a program to display the below fields after we select a material in the selection screen. MATNR - SALES ORG - DCHANNEL -  MATERIAL STATUS. I want one more field with the description of the material status to be displayed. How is