Skip to main content
Nintex Community Menu Bar
Solved

Set Value Of Single Line Text Field by Concatenating two Calculated Values

  • Jun 22, 2022 8:26 PM UTC
  • 7 replies
  • 1267 views
  • Translate All

kgiles
Forum|alt.badge.img+4

I'm using Nintex Classic Forms2013

Very new and very lost...
I have two Calculated Values: Date_ & Time_

These values update on form load

I want these two values to concatenate into a single line text field, TimeDate

Please and thank you!

Best answer by Garrett

Hi @kgiles 

 

Form Controls

1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination

3. Assign the Client ID JavaScript variable name to both control. (Settings - Advance)

 txtTime_Date

  txtDestination

 

4. Place the following code into the Form Settings - Custom JavaScript

NWF.FormFiller.Events.RegisterAfterReady(function() { var x = NWF$("#" + txtTime_Date).val(); var y = NWF$("#" + txtDestination); y.val(x); });

This will assign the value of Time_Date to Destination eg pass Time_Date value to Destination. 

as you stated - "Time_Date to set it's value to Destination."

 

Form Design

Form Output

 

hope that helps

View original

7 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • Jun 22, 2022 9:29 PM UTC

Hey @kgiles ,

 

Why not use a Calculated Value control instead of a single Line Text control?

 

On your Classic Form, Add a Calculated Value control.

Configure the Calculated Value control using the Formula Builder:

(Insert the variable by double-clicking them in the Named controls)

Formula: _Date + _Time

If you need to add a space in between 

Formula: _Date +" " + _Time

Preview the form to check the result. 

 

 

 

Translate

kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • Jun 23, 2022 12:43 PM UTC

Thanks for your help!

Setting the value of a single line text field based off of a calculated value is what I'm trying to focus on. I have many uses for this but no easy built in options to perform this action. 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • Jun 23, 2022 2:37 PM UTC

Hi @kgiles,

Could you elaborate with an example what you wish to achieve?

Did my suggestion help to resolve your initial issue?

Translate

kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • Jun 23, 2022 3:01 PM UTC
I changed up some values:
1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination
3. On form load, I would like Time_Date to set it's value to Destination.
Hope I'm making sense and thank you
Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • Answer
  • Jun 23, 2022 3:52 PM UTC

Hi @kgiles 

 

Form Controls

1. Calculated Value Name = Time_Date
2. Single Line Text Field Name = Destination

3. Assign the Client ID JavaScript variable name to both control. (Settings - Advance)

 txtTime_Date

  txtDestination

 

4. Place the following code into the Form Settings - Custom JavaScript

NWF.FormFiller.Events.RegisterAfterReady(function() { var x = NWF$("#" + txtTime_Date).val(); var y = NWF$("#" + txtDestination); y.val(x); });

This will assign the value of Time_Date to Destination eg pass Time_Date value to Destination. 

as you stated - "Time_Date to set it's value to Destination."

 

Form Design

Form Output

 

hope that helps

Translate

kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • Jun 23, 2022 4:48 PM UTC

Thank you so much! This opens a lot of doors. 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • Jun 23, 2022 4:56 PM UTC

You're welcome. Glad it manage to open doors for you.

Translate