Solved

operations with form fields in each row

Posted on 2011-03-16
6
329 Views
Last Modified: 2012-06-27
Hi,

I am trying to use simplified field notation to calculate a total from quantity and price on each line
I tried delivered\.0*price\.0 which works on a single cell.  When I tried to place multiple fields for 30 rows in a column, the 0 element was used for all.  Is there a way to specific the current row, like in an excel spreadsheet?

Thanks

Murray
0
Comment
Question by:jbmsystems
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35158498
Is this for a Designer or an AcroForm form?
0
 
LVL 3

Expert Comment

by:thepcwizard
ID: 35158510
Do you have a unique name for each field?
i.e. On row 1, deliever1 and price1
Otherwise, it will put the same data in every field with a non-unique name.
0
 

Author Comment

by:jbmsystems
ID: 35159150
The attached screen shot shows the naming of all the fields
pdf-array.jpg
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 35159180
This still does not answer my question: AcroForm or Designer form?
0
 

Author Comment

by:jbmsystems
ID: 35159522
this was designed in acrobat pro
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 35159899
Create a document level script named "calculateRow" and use the attached script for that.

Then edit the field properties for all your amt.X field and set a custom calculation script. Use the following line for that script:

event.value = calculateRow(event.target);

The calculateRow() script will figure out which row needs to be calculated and then assign the calculated value to the field.
function calculateRow(field)
{
    retVal = 0;
    // get the field name
    var name = field.name;

    var reg = /(.*)\.(\d+)/;
    var ar = reg.exec(name);
    if (ar != null)
    {
        var rowNum = ar[2];

        retVal = this.getField("delivered." + rowNum).value * this.getField("price." + rowNum).value;
    }

    return retVal;
}

Open in new window

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now