Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Multipurpose button

Avatar

Level 3

I have been struggling for a few days now on a submit button that I need to do many things.

I've read so many forums on this, but still can't get it quite right.

I need this button to email a pdf with the subject line that says District ## <---being a response from the form.

I need it to be electronically signed

I have tried.....

1. I made a submit button that I can click and it will sign and mailto URL, but can't figure out how to get the subject to be dynamic.

2. I have a regular button with a Javascript click code as...

var subject = "District " + district.rawValue;

var myDoc = event.target;
try {  myDoc.mailDoc({
        bUI
: false,
        cTo
: 'receiver@domain.com', // Replace with actual receiver mail address.
        cSubject
: subject,
        cSubmitAs
: "PDF"
   
});
} catch (e) {
   
// exception handling...
}

and then had it call another Submit button that is invisible that actually does the Submit / Sign etc.

    

     The problem with this one is it's trying to submit two times.

Does anyone have any magic they can share with me?

I have tried using the HTTP buttons as well to no avail.

Gretchen

3 Replies

Avatar

Level 10

don't call a second submit button, it's not convenient for what you are trying to do.. you can do everything you want with only one button...

1. For your email try this without a try catch

var oDoc = event.target;

                    oDoc.mailDoc({

                                                            bUI: false,

                                                            cTo: "bob@bob.bob",

                                                            cCC: "",

                                                            cSubject: xfa.resolveNode("Main.frmPart1.frmA.Subform124.txtTANo").rawValue,

                                                            cMsg: "You have received a PDF!"

                                                  });

it submit as PDF automatically

Avatar

Level 3

Thank you for your reply.

I have two questions at this time.

1. If I'm putting these under a regular button, how will I get the electronic signature to work?

2. This line is not behaving correctly.     

cSubject: xfa.resolveNode("District " + form1.Page1.TopPart.District).rawValue;

So I was wanting the subject to say District (then fill in the value from the text field on the form)

Thank you so much for your help.

Avatar

Level 10

resolveNode is a method that only searchs for nodes with the given string,

so in resolveNode() you must only insert somExpressions...

cSubject: "District " + xfa.resolveNode("form1.Page1.TopPart.District").rawValue;

euhmm and I never worked with electronic signature but you probably have an execValidate() method for your signature field?!?