Copy link to clipboard
Copied
Hi, I've got a form that an end user is completing in the browser. I want them to click the "submit" button, have a PDF get generated and displayed to the end user for printing and have a message replace the form the end user was on.
The form action is to another page (requestp.cfm) where a success message is suppose to be displayed in the browser and then calls a third page (makefile.cfm) that actually generates and displays the PDF. I know the cfcontent page causes other code to be ignored but I was hoping that by calling the pdf generation in a third file after all my HTML code that it would work as desired. Instead, the PDF opens in a new spawned window and the original form remains in the main browser window.
The requestp.cfm is:
<p>Success message here</p>
<cf_makefile id=#id#>
And the makefile.cfm ends with
<cfcontent variable="#test#" type="application/pdf" reset="No">
which I guess halts all processing and therefore never returns control to requestp.cfm, right?
Any suggestions on how to accomplish what we're looking for? So far my only other idea is for requestp.cfm to have a "Click here to print your request" link which seems lame.
TIA,
Kiyomi
Copy link to clipboard
Copied
Kiyomi,
Hi there, have you found a solution to your situation?
If not, I have some questions / comments for you.
Your title mentions that you desire to display and e-mail the generated PDF, but
in the body of your post you refer to displaying the PDF after displaying a brief
message.
So my question is, do you want to display it - or - e-mail it?
If you are just trying to provide a copy of submitted information (in PDF format) to
the submitter, why not just send it to them via e-mail using the <cfmailparam> tag
and forget the whole display / print part?
You could also set the e-mail to high priority with an additional <cfmailparam>.
Examples:
<cfmailparam file="[enter path to actual file]">
<cfmailparam name="X-Priority" value="1">
Then advise them in your message that a copy of what they have submitted, has
been e-mailed to the e-mail address provided and could even display the e-mail
address it was sent to in your message.
Leonard B
Copy link to clipboard
Copied
They wanted it displayed immediately to the end user who filled out the form - then they can print it and run off and get the necessary signatures.
Additionally the PDF is emailed to AP as a heads up that a request is coming. (I don't really understand why they want it, but they do...)
I solved it by calling the makefile request via a javascript window.open when the new page loaded instead of calling it via <cf_makefile id=#id#>.
-K
Copy link to clipboard
Copied
You could try a js function that replaces the form with your message and call it when the form is submitted.