Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

operations with form fields in each row

Posted on 2011-03-16
6
Medium Priority
?
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
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…

618 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