?
Solved

operations with form fields in each row

Posted on 2011-03-16
6
Medium Priority
?
363 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
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…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
Suggested Courses

777 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