Copy link to clipboard
Copied
I am wanting to create an if statment like so....
<CFIF #URL.PDF# EQ 'Yes'>
<body>
<cfdocument format="pdf">
<cfelse>
<body onLoad="window.print() ">
</CFIF>
However I cannot get this to work it throws an error. Is there a way to do this.
Copy link to clipboard
Copied
What is the value of the pdf variable and what is the error message?
Copy link to clipboard
Copied
The value of the pdf is no at the end of the document I am trying to at
<CFIF #URL.PDF# EQ 'Yes'>
</CFDOCUMENT>
</CFIF>
I am trying ot use one page that the user goes to and either gets to print or PDF based on what the selected on the previous page.
The error msg is "
Copy link to clipboard
Copied
<CFIF #URL.PDF# EQ 'Yes'> </CFDOCUMENT>
</CFIF>
You cannot split the opening and closing cfdocument tags that way, or most cf tags for that matter. The entire cfdocument must reside within the cfif tags:
<cfif URL.pdf eq "someValue">
<cfdocument....> content </cfdocument>
</cfif>
Also, you can get rid of the extra # signs. They are not needed.
Copy link to clipboard
Copied
cfsavecontent might save you some typing in this situation.