Expand my Community achievements bar.

Change text on submit by email button

Avatar

Level 3

Ok, here's what I want to do and I hope you guys can help me, I haven't had much luck yet.

I have a hidden sections, they appear based on check boxes chosen.  There are 3 choices, one is initially visible (default) the other 2 only if one of the other two checkboxes are chosen.

These are essentialy special handling slips.  What I have done is add a submit be email button to the 2 handling slips (instructions that need to be sent to specific personnel).  When the user hits the email button I need them to be prompted to select one of three email addresses - either from a drop down box or list box and based on which address they choose the text of the button will change to read "Sent by email to 'email address selected'".

Can this be done?  If so can someone PLEASE send me some sample code?  I'm using LiveCycle 7.  Thanks.

3 Replies

Avatar

Level 6

Here is what you need to do........

1. Save the form as Dynamic template

2. Add following line of JS code in Dropdown "change" event

     Button1.execEvent("initialize");

     //may have to referece your button with SOMexpression like xfa.form1...........

3. Add following JS code in Button's "initialize" event

     if (DropDownList1.xfa.event.change == "Please Select") {

          xfa.resolveNode("this.caption.value.#text").value

= "Email";

     }

else {

          xfa.resolveNode("this.caption.value.#text").value

= "Email " + xfa.event.change;

     }

4. Add following JS code and customize to your needs in the "click" event of the button

     var to, sub, ebody;

     to

= "xyz@xyz.com"

     sub

= "subject text goes here"

     ebody

= "email body text goes here"

     event.target.submitForm({cURL

:"mailto:"+to+"?subject="+subj+"&body="+ebody,cSubmitAs:"PDF",cCharset:"utf-8"});

Attached sample for your convenience

Good luck,

Avatar

Level 3

Thanks that was really helpful. However, as often happens in the office we've had a change of mind as to the best methodology for personnel to receive the info I want.

Ok, so here's the scenario.  I only need a portion of this document, again special handling slip, to go to someone.  However what we now think will work best if the data only is sent to a specific location on a network drive in excel format.  I think XML would work just as well so you need not worry too much about it needing to be Excel.  This way if Person A is out, the information isn't sitting in their inbox until they come back, whomever is working that desk can retreive the info from the network drive.

Ok, so we are in a Citrix environment, in case that adds any wrinkles to this - usually does for most everything.

So I'm thinking since the special handling slip is a subform I can just submit that portion of the data using an submit or excute button, but not sure how to do it.  Hope this makes sense.

I really appreciate your assistance.  I've attached the form I'm working on, not the special handling slip with the button is hidden (exclude from layout).  I've removed any private data from this sample.

Avatar

Level 3

Initial question answered.  Thanks.  Any idea how to help with the follow up to my question?