You are viewing limited content. For full access, please sign in.

Question

Question

How to display the value of a field found in a collection into another collection on the same form

asked on April 15, 2017

Hi all,

Is it possible to display the value of a field found in a collection into another collection on the same form?

The below is in collection 1: For e.g: 'Sheila' is in the First Name field and 'VAR Aline' is in the Last Name field.

The below is in collection 2: I want to show the value of the 'First Name' and value of 'Last Name' into the below field. It should read as follows: 'Sheila VAR Aline'

Thanks to advise how to do same.

 

Sheila

0 0

Replies

replied on April 17, 2017 Show version history

Hi Sheila,

Normally you can use CONCATENATE in the calculation field of "Single Line" Collection with the variables being FirstName and LastName and the Collection Variable being Personal_Details.

=CONCATENATE((Personal_Details.FirstName)," ",(Personal_Details.LastName))

But it seems at the time that the space is not working correctly.  I have read on another answers post that it will be fixed in the near future.  (Notice the Name field in the first collection on the attached)

So since you cannot do it that way, JavaScript seems to work just fine.

// Autofill Field with variable 
$(document).ready(function () {
  $('.firstname, .lastname input').change(function () {
    $('.name input').val(($('.firstname input').val())+" "+($('.lastname input').val()));
    })    
  })

//End autofill with variable
 

This is using the variables FirstName and LastName in the Personal_Details collection with the CSS Class as "firstname" for FirstName and "lastname" for LastName and then using CSS Class "name" for the variable Name2 in the second collection 

Collections.PNG
Collections.PNG (15.86 KB)
2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.