concatenating values from two fields into one field | Community
Skip to main content
New Participant
October 4, 2010
Question

concatenating values from two fields into one field

  • October 4, 2010
  • 11 replies
  • 16608 views

Hi everyone,

I have two text fields at the top of my form for the user to type in their first and last names. I originally set the two fields to be global so that when I placed two identically named fields in the footer the values would automatically be repeated in that area across the document.  This has worked but I've since decided though that instead of having two separate read only fields in the footer, I'd like to run some javascript so that the combined first and last names will be entered into one field only.

I put the following code on the text field in the footer:

var first = student-info.firstname.rawvalue;

var last = student-info.lastname.rawvalue;

Concat(first, Space(1), last);

This hasn't work though.

My knowledge of javascript is quite limited so I wondered if someone could tell me where I've gone wrong in the code?

Appreciate any assistance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

11 replies

October 4, 2010

The Concat function is a formcalc function not javascript.

To do this in javascript use this:

Fieldname where you want to put the result.rawValue = first + " " + last

Paul