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
BernardGBaileyAsked:
Who is Participating?
 
Sar1973Connect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.