Expand my Community achievements bar.

SOLVED

Create dropdown that emails based on info

Avatar

Level 1

I am creating an email dropdown list that I want to "user" to push the button and based off the airport code menu item that is selected directs to whom the email gets sent. (Each menu item has more than one email attached to it.)

I have already discovered that Livecycle doesn't like multiple buttons to accomplish this.  I have read some java/xml that has led me in a direction, but I am pretty lay if it doesnt apply directly to me ing and need bit of hand holding the first time round.  My attempt to run it give me a dropdown not declared even though I used the designer to accomplish the dropdown.

Can anyone help me as to what the java, xml, or both that I need?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Here is a sample. Have a look in the click event of the button. It looks at the rawValue of the dropdown and then sets up the email appropriately.

The script uses a switch statement to look at the value and set the email address and subject line. You could also set the body of the email to be airport specific as well.

Lastly, the script is set up to send an email only. If you want to send a form, then the replacement script is in the text below the button.

Good luck,

Niall

View solution in original post

9 Replies

Avatar

Correct answer by
Level 10

Hi,

Here is a sample. Have a look in the click event of the button. It looks at the rawValue of the dropdown and then sets up the email appropriately.

The script uses a switch statement to look at the value and set the email address and subject line. You could also set the body of the email to be airport specific as well.

Lastly, the script is set up to send an email only. If you want to send a form, then the replacement script is in the text below the button.

Good luck,

Niall

Avatar

Level 1

Awesomelly Stellar!

I did forget to mention one thing though... The email that is generated, I want to have a .xpd (LC xml package) and .txt of the form that they fill out attached to it.  If I can't get both.  The .xpd is the preferred attachment.

THANKS AGAIN!

Jo

Avatar

Level 10

Hi Jo,

Here is the form with the two last lines of script changed over to send the form as an attachment to the email.

If you see the cSubmitAs: script, you can determine the format of the attachment (form) as either XML, PDF or XDP.

Amended form attached.

Good luck,

Niall

Avatar

Level 1

SMASHING SUCCESS!!!!  Thank you!

Would it be a bother for one more question?

What and where would I add the script for having the attached file named as "Change Request" instead of the default generated name?

That was technically two questions, but I will take a risk... 

Thanks again!!!

Jo

Avatar

Level 10

Hi Jo,

When you preview the form from within LC Designer, it will give a generic/random name. However when you go outside of LC and open the form in Acrobat, the email attachment will have the name of the form (which could be set to Change Request before you send it out).

Changing the name of the form is a security issue and requires a trusted function. This is just some script in a javascript file, but that .js file needs to be installed on every computer that will use the form. It depends on who will be using the form as to whether this is more trouble than it is worth.

Short answer, it can be done, but it takes some additional work and can be a pain to maintain. There is an example of a form and .js file here.

Glad you have it working,

Niall

Avatar

Level 1

Niall,

If I would have taken the time to test it in Acrobat instead of LC, instead of having a blonde moment.  (forgot LC does that..) I would have seen that the form is doing what I wanted...   I want the file to remain static (database use), just not with one that isn't going to have meaning for the user.

Thanks for the link, incase I ever want one that changes.

The form is beautiful and awesome just the way it is!!!!    Love it!

Jo

Avatar

Level 1

UGH!!!

When I tested the form on a user computer with Reader 9.0, everything is great till the email/submit button.  The user computer is hanging and not opening an Outlook message with the file attached.

I have been trolling other forums with no luck finding the right answer.  Got any ideas what it could be?

Thanks,

Jo

Avatar

Level 10

Hi,

If you are using the form with Reader then there may be an issue with the email button.

If your form is not Reader Enabled, then the user cannot save the form using Reader. This is an internal step in attaching the form to the email. One solution is to change the format of the attachment from XDP to XML. Users with Reader can send the form data back in XML format (even if the form is not Reader Enabled).

If you want to Reader Enable the form there are two choices (1) using Acrobat, which has licensing restrictions or (2) using the full LC Reader Extensions ES server product, which is costly and intended for large organisations.

Here is a summary of how to deploy a form, depending on what the user has (Acrobat/Reader) and whether the form is reader enabled.

Hope that helps,

Niall

Avatar

Level 1

I am doing a happy dance!!!  It worked!    User-enabling was suffice.

Thanks again, You Rock!

Jo