Highlighted

Script - Changing Submission Format

JoshDBoyle-DVzR

10-11-2008

All



I need a line of Javascript of FormCalc code that changes the form's submission type from XDP to PDF. I have arrived at the following but am unsure if it is correct:



$.#event.#submit.format = "PDF";



Any ideas?

Replies

Highlighted

pguerett

11-11-2008

Here is the javascript command assuming that your button is called EmailSubmitButton1:



EmailSubmitButton1.event__click.submit.format = "pdf";



Note that the parameter pdf is case sensitive and must be lowercase.
Highlighted

Avatar

Guest

11-11-2008

Alternatively you can use the following format:

xfa.resolveNode("Button1").nodes.item(0).nodes.item(0).setAttribute("pdf","format");
Highlighted

JoshDBoyle-DVzR

11-11-2008

Hmmm I believe both of the above work but my problem still persists. Let me explain further:



I am using an XFA Form throughout my workflow but prior to the final user step (a step where a Digital Signature will be applied) I covert the XFA to a Document Form. This Document Form is then what I present to the user at the final workflow step.



Since it is a Document Form, my Workspace button of "Complete" isn't working and I was told that if I changed the submission type of the form's submit button from "XDP" to "pdf" then it might.



Any ideas?
Highlighted

pguerett

11-11-2008

Ah now I understand what is happening ..... doid you drop the process fields onto your form? If you did, then it the Hierarchy view you can click on the FSSSUBMIT_ button. Then in the Object palette, click on the Submit tab. In the Submit As dropdown select PDF. Save your form and try it again.
Highlighted

JoshDBoyle-DVzR

11-11-2008

Well, I believe I need the submission to be XDP throughout the workflow and only have it change to PDF prior to the final user step where the form gets Digitally Signed - thus my request for the code to do so dynamically.



I tried applying the code you offered on the FSSUBMIT_ button as opposed to my actual Button1 I put on the form but to no avail. When I click the "Complete" button in Workspace, the form just sits there.
Highlighted

JoshDBoyle-DVzR

11-11-2008

When I try to click on either my generic submit button (Button1) or on the FSSUBMIT_ button, I get a message box displayed that simply says "Submit cancelled".



The form doesn't go anywhere.
Highlighted

Luigi_247_365

12-11-2008

"Submit cancelled" - you may have added your own scripting to the process fields default scripting, that is causing an issue.



coming back to your original question - try the following below:



Javascript



PDF Submission

event__click.submit.textEncoding="UTF-16";

event__click.submit.xdpContent="pdf datasets xfdf";

event__click.submit.format="pdf";



XDP Submission

event__click.submit.textEncoding="UTF-16";

event__click.submit.xdpContent="pdf datasets xfdf";

event__click.submit.format="";



hope it helps.
Highlighted