[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

operations with form fields in each row

Posted on 2011-03-16
6
Medium Priority
?
372 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Suggested Courses

830 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