Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - build email text from PDF form
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

build email text from PDF form

 Post Reply Post Reply
Author
lauracp View Drop Down
New Member
New Member


Joined: 31 Jul 2018
Points: 2
Post Options Post Options   Quote lauracp Quote  Post ReplyReply Direct Link To This Post Topic: build email text from PDF form
    Posted: 01 Aug 2018 at 6:57pm
Hi There,

I'm working on building a PDF form with a submit button that will email the completed form to a set address. I've run into a couple stumbling blocks and would greatly appreciate some help:

1) I can get the submit button to work when this form is opened and completed using almost every PDF application i can think of, except PDF X-Change Viewer. I'm not sure if there is anything specific I should know in order to make it work here also, any tips??

2) i used javascript to build the email subject line & body text from completed information from the form. everything seems to be working as i want it to except for checkboxes. I would like a checked checkbox to result in the value being populated into the body text of the email, and if left unchecked i would like no text to populate (blank). below returns the desired result when the box is checked, but returns "Off" when left unchecked.

        // Build message body
        var body_text = "";
        body_text += getField("checkbox").value;

if i change it to this

        body_text += getField("checkbox").exportValues;

I get the desired export value whether the box is checked or unchecked.

I figure i need some sort of IF/ELSE statement but i'm not sure how to word it correctly.

any thoughts?

thank you,







Edited by lauracp - 01 Aug 2018 at 6:58pm
Back to Top
Sponsored Links


Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 627
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 02 Aug 2018 at 4:05pm
You can use this code to achieve it:

var cbValue = this.getField("checkbox").valueAsString;
if (cbValue!="Off") body_text += cbValue;
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
lauracp View Drop Down
New Member
New Member


Joined: 31 Jul 2018
Points: 2
Post Options Post Options   Quote lauracp Quote  Post ReplyReply Direct Link To This Post Posted: 02 Aug 2018 at 4:40pm
that seems perfect

any suggestions on how to separate the export values using a comma

thank you!


Edited by lauracp - 02 Aug 2018 at 4:42pm
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 627
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 2018 at 1:03pm
Something like this?

if (cbValue!="Off") body_text += cbValue + ", ";
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.