Solved

operations with form fields in each row

Posted on 2011-03-16
6
334 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

948 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

23 Experts available now in Live!

Get 1:1 Help Now