How to use calculated fields in a form to return a concatenated value?

Posted on 2012-09-18
Last Modified: 2012-11-22
Hi team,

I have some fields in a pdf form which I want to use to capture dimensions, when the dimensions are loaded from dropdown lists. I want to calculate a partno off the selections made.

The fields are as in the row immediately below.

PipeType  |  Upstand      |  Soffit      | Cladding      | StudHeight|

Options for each field is as below

80mm Round      |    65            |  600             |   70 Brick|  2400            |
110x50 Sq      |    85            |  450             |   90 Brick|  2700            |
Universal        |   110            |  750             |   Linea        |                    

I understand I need a calculated field each of these fields to return the single value from each field. There will also be a 6th calculated field required to concatenate elements from the field data selected.

Say I filled the form fields with the following data
80mm Round      |    110      |  450             |   90 Brick|  2700            |

Then the concatenated data will look like

DP 80 110 450 90 2700   or strung together DP80110450902700

I can see I need to use the Custom Calculation scripts; but I am not sure of how to write the script to return the 70/90/ other value for Cladding type into a result field; and in particular the form of the calculation to concatenate string text fields to numeric value fields.    

Any help would be appreciated

Question by:BernardGBailey
    1 Comment
    LVL 9

    Accepted Solution

    You could define a string and the concatenated string like this:
    var myString;

    var myPipe=document.getElementById("PipeType").value;


    var myPipe = document.getElementsByName("PipeType")[0];

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    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 second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
    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 …

    760 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

    10 Experts available now in Live!

    Get 1:1 Help Now