Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Two submit buttons going to two different email addresses

Avatar

Level 3

Hello Everyone!

I'm trying to have two separate buttons inside my form that simply email my pdf to two different addresses.  For some reason though the first button I create and enter an email address for takes presedence over all the rest of the buttons I create.  So I create button1 with email address bob@bob.com then i create another button2 and say that has an email address of larry@larry.com well what is happening is no matter what i put in button2's properties or inside the XML it still puts bob@bob.com in the to line of the email.  I am using the button object and changing it to a submit with the PDF option selected from the drop down.  I have been able to do this in the past but since i have upgraded to Lifecycle 8.2 I can no longer get it to work right.  Any help is appreciated.  I don't know how to code in lifecyle but I do understand the principles of programming so if it is something that i need to do "under the hood" so to speak then please give me that option also.

I am also receiving this warning:

"This document has accessed more than one site and may be trying to share data among different locations.  This could be a privacy concern.  Are you sure you want to continue?"

I have attached the form for further review.

J

16 Replies

Avatar

Former Community Member

Just tried it here and it worked fine for me. Are you using Acrobat.com to distribute the form? Try it form preview ....do you get the same behaviour?

Paul

Avatar

Level 3

Hello,

In form preview is where i get this behavior and in acrobat 9.0 but I don't outside of those two applications.  So if I send it to someone with reader the form works like its supposed to but if "I" open it using 9.0 or lifecycle both don't work in the preview pane.  So really it is working though the preview pane and 9.0 which are probably built on the same code for previewing the form aren't working properly.

I'm not using acrobat.com to distribute the form, I'm using the mailto: function to send to a few different people currently.

Justin

Avatar

Former Community Member

I am previewing it using version 9 of Acrobat and I am not seeing the problem.

Paul

Avatar

Level 3

Good Morning,

The problem comes in when I fill out the form then send it to another person then they try and send it back.  The form I have uploaded has two different email addresses on each button but when I send the form filled out to another person and they get it, save it, then click the email button to send it back the button "target" defaults to their address and not mine which it should as that is what is set in the XML.  I'm not sure why this is happening yet and still testing but this was that last scenario I tested and the one I need to work to have this form work properly.

Thank you for all your help and advice so far I really appreciate it

J

Avatar

Former Community Member

Just tried that scenario here and it worked fine .....I am using Outlook.

Just to make sure that we are testing the same thing.

I render th eform click the left button and email the form to someone else. That person recieves the form clicks the right button and you say the original email address is in the To field and not the address that is programmed in the button....right?

Paul

Avatar

Level 3

Hello,

The problem comes in when two people have reader it looks like.  So you could only test this by having two pc's that have reader only and don't have acro pro on either pc.  The problem is that when you use the first button "email button" and then send the filled out form to someone else they get the form and read it then click a readio "approve" or "not approved" and click the other email button it doesn't use the code for that button but for some reason it uses the first button that was clicked on the form from when it was sent.

Justin

Avatar

Former Community Member

I duplicated the issue although I have no idea why it is happening . What version of Acrobat/Reader are you using? If you reorder the buttons in the hierarchy view then it will always take the address from the top button. I am thinking that it might have something to do with multiple email connections form a form. We coudl do a single email connection button and programatically change the address so that only one connection is made. Would that be acceptable?

Paul

Avatar

Level 3

Hey Paul,

Thank you for the reply!  I'm not sure how to program this as I only understand web forms using PHP to process and mysql to store to a point.  I'm not certain I could figure out the programming to say something like "If emailButton1 is activated then emailButton2 is false" or something that would return a bolean value of sorts or an email address.  So, for instance, I could have a drop down list that asks for an email address and have that value be stored in a "var email" variable then use that as the value inside the "to" line of the email but I have no idea how to accomplish this using Adobe.  If you could help with the programming I would be much appreciative.

Thank you in advance,

Justin

Avatar

Former Community Member

Are you happy with the two button system you have today? I assume the user will know which one to push ......otherwise how do we know which button to make active and which one to hide?

Paul

Avatar

Level 3

Hey Guys,

The two button system is only there so when you click one button it goes to one email address and clicking the other goes to another email address.  The two button system is the only way I could figure out how to make it work using a PDF.  Do you have another option using adobe that I haven't explored maybe?

Any help is much appreciated!!

Justin

Avatar

Former Community Member

I have modified your sample to show you how. Note that there is a new button added. The Real Email button is the one that actually connects to the email system. This button can be made invisible once you are convinced this works. The other two buttons are visible to the user and will modify the properties of the submit button to your liking then will actually click it. In this way there is only one submit button and we are adjusting propeties of that button accordingly.

Paul

Avatar

Level 3

Hey Paul!!!!!!!!!!

Worked perfectly     Thank you very much.  I don't quite understand how you changed the properties using javascript as don't have a whole lot of knowledge of javascript.

Justin

Avatar

Level 1

Hello pguerett,

I read the advice you gave to ndjustin20 and I was wondering if you could help me out with the same issue with having two submit buttons going to two different email addresses. I try following along with what you were saying, but was getting confused on how you were going about to fix the warning i am receiving about “"This document has accessed more than one site and may be trying to share data among different locations.  This could be a privacy concern.  Are you sure you want to continue?”.

I’m new to adobe’s discussion board and new to LiveCycle Designer and I’m not too diverse in java scripting. I used the “Email submit button” option in the library palette to add the buttons to my form for whoever is filling out the form to e-mail them back to one of the two email addresses.

I am attaching the form for your review. Anything you can help me with on this will be greatly appreciated. Thanks!

Rene

Avatar

Former Community Member

Here is a modified version of the form. I turned your email buttons into regular buttons so that I coudl add script to them. Then I added another button (submit type) that will do the actual email (RealEmail). Then I modified your buttons to update the parameters of the email button to actually send the email. I modified one of the addresses to test with as you had it as the same address on both buttons.

paul

Avatar

Former Community Member

I have the same issue is this something you can write out how to do? I created 3 buttons to 3 different email address. Our staf would click the appropriate one as they fill out the forms from Adobe Reader. When I am in Acrobat it works but not from Reader I get the same error messages as the people above. How can I make this work?

Charley

Avatar

Former Community Member

If it works in Acrobat that means that the button and the code is fine. Did you Reader extend the form before trying it in Re

ader? Reader will not allow you to email without Extending the File first. What version of Acrobat do you have?

Paul