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

InDesign Forms creation Custom subject line

New Here ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

Hello,

I am working in InDesign creating a custom form. I am making my email address an active link. I want the subject line to pull from a fillable textbox (company name). So when I recive emails from customers each one has a logical subject line.

How do I do that?

Thanks

Views

729

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

Community Expert , Aug 07, 2018 Aug 07, 2018

dh23403567  wrote

paste below into script box

var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;

var cBody = "Any text you want to automatically appear in the email body"

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

You missed the cToAddr variable. The first line should be:

var cToAddr = "youremailaddress@yourdomain.com"

I'm sorry I didn't catch that sooner.

Votes

Translate

Translate
Community Expert ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

This can't be setup in InDesign, but it can be added to your email link after export to PDF using Javascript in Acrobat DC. If you're interested, post back here saying so and I'll demonstrate.

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 ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

Yes please. I'd appreciate the help

Thanks for your time

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
Community Expert ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

Notes:

  • You can and should remove any pre-extisting actions set using mailto: or whatever was originally setup and let the Javascript do all the work.
  • You can include the data from any field in the variables the same way, using:+ this.getField("fieldName").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 ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

Unfortunately It didn't work. I click the new button and nothing. I tried a button text box a few things.

Any idea where it went wrong?

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
Community Expert ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

dh23403567  wrote

Any idea where it went wrong?

Without a lot more detail about what you've actually got there, of course I could only guess. Does your email client respond to a simple mailto: linkage?

Instead of the whole script, you could try just:

doc.mailDoc({bUI: true});

That should trigger a new email with a copy of the PDF attached.

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 ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

I'm sorry I should have been more clear.

When I say it didn't work I mean nothing happened in acrobat when I clicked.

It didn't evoke my email system, give an error nothing.

The email hyperlink link worked for sending from InDesign.

I removed it before I tried to set it up in Acrobat

Thanks

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 ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

My Steps so far

Acrobat Pro DC (to add email prompt box)

InDesign CC (to create base form)

Select Prepare Form

Add a "Print Clear or any other type of button"

Properties - Actions - Mouse up - run javascript

paste below into script box

var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;

var cBody = "Any text you want to automatically appear in the email body"

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

Close Prepare form options.

Click box

Nothing happens

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
Community Expert ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

Do you have a field named companyName (exactly)?

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 ,
Aug 07, 2018 Aug 07, 2018

Copy link to clipboard

Copied

Yes, exactly the same.

If you have an address that can receive files, I could email you a file that only contains the text field and the button.

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
Community Expert ,
Aug 07, 2018 Aug 07, 2018

Copy link to clipboard

Copied

dh23403567  wrote

paste below into script box

var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;

var cBody = "Any text you want to automatically appear in the email body"

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

You missed the cToAddr variable. The first line should be:

var cToAddr = "youremailaddress@yourdomain.com"

I'm sorry I didn't catch that sooner.

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 ,
Aug 07, 2018 Aug 07, 2018

Copy link to clipboard

Copied

Seems like this is going to to the trick!.

Thanks for your help. It is very much appreciated.

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
Community Expert ,
Aug 07, 2018 Aug 07, 2018

Copy link to clipboard

Copied

I'm glad you've got it sorted out. You are welcome.

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

If you have any ideas for creating an order form that could be used on mobile devices or web browsers, I'd greatly appreciate it.

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
Community Expert ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

The best idea is to forget about InDesign and PDF and create a form on the website.

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Thanks for your feedback Bob.

Could you be more specific, are you referring to a do it yourself website creator?

What website is "the website"

Thanks

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
Community Expert ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

The best idea is to forget about InDesign and PDF and create a form on the website.

dh,

Bob's comment echos my offline reply to you regarding the pitfalls of broadcast PDF forms, and my recommendation that HTML forms are a better solution for universal consistency. I expect by "the website" he refers to your (or your client's) company web site, or whatever web space you might have available to host a form.

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
Community Expert ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

John’s explanation is exactly what I was referring to.

Are you saying you don’t have a website?

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Yes we do. I have never created a custom html form and am looking for some tutorials or a program to help build a custom form.

Thanks again guys.

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
Community Expert ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Is it a WordPress site?

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

I'm just providing content. I don't have any details on the site development.

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
Community Expert ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Then I can’t help here. If you can find out more about the site, I might be able to give you a bit more guidance.

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

I appreciate your time trying to help me.

Thanks

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
Community Expert ,
Aug 03, 2018 Aug 03, 2018

Copy link to clipboard

Copied

This may be optional, but I'd recommend that you rename your [company name] field (can be done in InDesign or Acrobat) to eliminate the space. I use camelCase, so I'd make it "companyName"

Then, in Acrobat, enter Form Edit mode and go to your email link.

  1. Right-click on that field and choose Properties.
  2. Click on the Actions tab and set a Trigger using the Select Trigger menu; typically Mouse Up
  3. From the Select Action menu, choose Run a Javascript
  4. Click the Add button. A Javascript-edit window will open
  5. Paste this:

var cToAddr = "youremailaddress@yourdomain.com"

var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;

var cBody = "Any text you want to automatically appear in the email body"

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

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 ,
Aug 20, 2020 Aug 20, 2020

Copy link to clipboard

Copied

LATEST

With regards to:
var cBody = "Any text you want to automatically appear in the email body"
How does one include a paragraph space into the body of the email, so we can say, for example:
Dear Mrs....,
[paragraph space]
Please find attached to this email, etc....

Your reply above has been very helpful for a project I am currently working on, I would be grateful to know how to further expolit this cool tip. 

Thanks so much!

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