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

How to submit form via email and make subject line a form field?

New Here ,
Oct 26, 2018 Oct 26, 2018

Hello, I have looked through similar questions/answers and tutorials about this but I can't get it to work for me. I am not a coder by any means and this is all new to me.

I am trying to make it so that when someone clicks the "Submit Form" button, the PDF is sent as an attachment in an email, and the subject line is one of the fields on the form. The email itself is easy enough (Submit Form, mailto:emailaddess@server.com); but I can't get the subject line to pull from the field.

I entered the code below into the Mouse Up event of the button, as some tutorials suggested, but nothing happens now when I click the Submit Form button.

Thank you for any help!

TOPICS
PDF forms
7.5K
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 ,
Oct 26, 2018 Oct 26, 2018

You didn't use the code correctly... Remove the "Submit a form" command and add a "Run a JavaScript" one instead, and then paste the code into the window that opens.

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 ,
Oct 26, 2018 Oct 26, 2018

What happens when you use it? Check the JS Console (Ctrl+J) for error messages if nothing happens.

For future reference, never post code as a screenshot. Copy and paste it as text.

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 ,
Oct 26, 2018 Oct 26, 2018

Nothing happens, no error messages or anything. Button just clicks without any event

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 ,
Oct 26, 2018 Oct 26, 2018

Can you share the file with us (via Dropbox, Google Drive, Adobe Cloud, etc.)?

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 ,
Oct 26, 2018 Oct 26, 2018
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 ,
Oct 26, 2018 Oct 26, 2018

You didn't use the code correctly... Remove the "Submit a form" command and add a "Run a JavaScript" one instead, and then paste the code into the window that opens.

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 ,
Oct 26, 2018 Oct 26, 2018

I know, I moved it to the Submit Form line to see if it would work. I just re-added it to the JavaScript window. Still nothing

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 ,
Oct 26, 2018 Oct 26, 2018

Share it again, please...

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 ,
Oct 26, 2018 Oct 26, 2018
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 ,
Oct 26, 2018 Oct 26, 2018

Look in the Console after clicking the button...

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 ,
Oct 26, 2018 Oct 26, 2018

What/where is the console?

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 ,
Oct 26, 2018 Oct 26, 2018

It's where you can execute JS code on its own and where error messages in the existing code appear.

As I mentioned above, press Ctrl+J to open it.

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 ,
Oct 26, 2018 Oct 26, 2018

This is the error listed there:

TypeError: this.getField(...) is null

1:Field:Mouse Up

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 ,
Oct 26, 2018 Oct 26, 2018
LATEST

There was another error message before that. You used getfield instead of getField. Maybe you changed it already...

That error message means you used the wrong field name.

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