• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

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

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.

eg.
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

Cheers
Bernard
0
BernardGBailey
Asked:
BernardGBailey
1 Solution
 
Sar1973Commented:
You could define a string and the concatenated string like this:
var myString;

var myPipe=document.getElementById("PipeType").value;
...myUpstand
myString=myPipe+"/"+myUpstand+"/"+(whatever);

//OR DEPENDING ON YOUR HTML

var myPipe = document.getElementsByName("PipeType")[0];
...myUpstand
myString=myPipe.options[myPipe.selectedIndex].text+"/"+....
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now