These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Submit emails based on checkboxes selected

rdinapoli
Registered: Feb 21 2009
Posts: 6
Answered

I'm "very new" to Livecycle with little javascript/formcalc experience. I've gotten by by the seat of my pants using canned formcalc and javascript examples to do most of what I've needed to get done.

I've created a 2 page form which has checkboxes to determine who gets an email of page 1, 2 or the whole PDF of a filled in form. The emailsubmitbutton is not the answer so I figured I could use a generic button and create a script which would check the status of each checkbox "1" to email, "0" not to. Therein lies the problem...

I can't believe no one ever needed to send emails based on which checkboxes were selected.

Any help would be greatly appreciated.

Rich

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can do it in this way.
It's just a hint, I didn't test it.

if (checkBox.rawValue == "0"){var address = "<span class="spamspan"><span class="u">Jack</span> [at] <span class="d">domain [dot] com</span></span>";}else{var address = "<span class="spamspan"><span class="u">John</span> [at] <span class="d">domain [dot] com</span></span>";} myDoc.mailDoc({bUI: false,cTo: address,cSubject: subject,cMsg: msgBody,cSubmitAs: "PDF"});

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

rdinapoli
Registered: Feb 21 2009
Posts: 6
I really appreciate your quick response but I couldn't get it to work, surely my fault and not yours. As I said, I'm very new to all this and my understanding is not what it should be.

So I've rethought my problem and I "believe" a possible solution would be to have a single submit button that when pressed, would send 2 seperate emails, one with the complete PDF to a group of emails and one to another set of emails with only page two. If that isn't doable than 2 seperate submit buttons. How could I accomplish this, also is there a way to keep the submit buttons from being displayed in the final PDF?

Again, thanks for any help.

Rich
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Ok, I see i misunderstood your first description:

To be clear.
You can't send 2 separate mails at once by clicking a button, only one after one!

You can control the mail result in several ways.
So you can use a checkbox to change the recipients as in my example above.
You also can use this checkbox to control the visibility of the pages in your form, means you can hide pages, so the receiver can't see them.

And you also can set the visibility of your buttons to hidden (although I don't think this is a good idea. Image, it can happen that you have to send you form again.)

This are many different tasks for your form that need a lot of customized scripting.
I really can't guide you through this step by step, so please watch the tutorials in the forum.
The answers are there.
You should train with the exsamples there first.

http://www.acrobatusers.com/learning_center/tutorials
http://www.acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

rdinapoli
Registered: Feb 21 2009
Posts: 6
I will look at the tutorials and hopefully that will answer any other questions I have.

Thanks for all your help!