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

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

New Here ,
Sep 05, 2024 Sep 05, 2024

Copy link to clipboard

Copied

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

Views

57

Translate

Translate

Report

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

correct answers 1 Correct answer

Advocate , 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;

 

 

Votes

Translate

Translate
Advocate ,
Sep 05, 2024 Sep 05, 2024

Copy link to clipboard

Copied

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;

 

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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