Skip to main content
Participant
September 5, 2024
Answered

How to combine Text Field and Drop Down menu into complete sentence

  • September 5, 2024
  • 1 reply
  • 587 views

Hi everyone.  

I have a Dropdown menu of different style boxes: "Box1" "Box2" "Box3"

A Text field of customers name: "Customer Name"

A Text field of "Shipping Address"

 

I would like these three information sources to combine to create a sentence in another Text Box (named "Customer Order") such as:

 

"Customer Name" would like the gift placed in "Box2" and this to be delivered to "Shipping Address"

 

I currently have the script below but struggling how to code the CUSTOMER NAME and SHIPPING address part within the sentence, I have tried to show below.

 

var dropdownValue = this.getField("Box Style").value;

switch (dropdownValue) {
case "Box1":
this.getField("Customer Order").value = "CUSTOMER NAME would like the gift in Box1 and this to be delivered to "SHIPPING ADDRESS ";}

 

Many thanks

This topic has been closed for replies.
Correct answer PDF Automation Station

Enter the following custom calculation script in the "Custom Order" field:

 

 

event.value=
this.getField("Customer Name").value +
' would like the gift placed in ' +
this.getField("Box Style").value +
' and this to be delivered to ' +
this.getField("Shipping Address").value;

 

 

1 reply

PDF Automation Station
Community Expert
Community Expert
September 5, 2024

Enter the following custom calculation script in the "Custom Order" field:

 

 

event.value=
this.getField("Customer Name").value +
' would like the gift placed in ' +
this.getField("Box Style").value +
' and this to be delivered to ' +
this.getField("Shipping Address").value;

 

 

Participant
September 5, 2024

Thanks for your help, works perfect except for some reasong the customers name is displaying on the first line and the rest of the text and options are showing on line 2 rather then all together on a single line?

Participant
September 5, 2024

Sorted, I had rich text formatting selected.  Thank you for your help