Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Sep 05, 2024 Sep 05, 2024

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

TOPICS
How to , JavaScript , PDF , PDF forms
386
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Sep 05, 2024 Sep 05, 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;

 

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2024 Sep 05, 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;

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 05, 2024 Sep 05, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 05, 2024 Sep 05, 2024
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines