Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

ColdFusion Function and JavaScript

Question posted by: cfmx2008 (Member) on March 13th, 2008 02:14 PM
Hi everyone,

I have a coldfusion form (ReportMenu.cfm) that the action page is itself as below:
Expand|Select|Wrap|Line Numbers
  1. <cfform action="/cfreport/ReportMenu.cfm" method="POST" enctype="multipart/form-data">

and it's button:

Expand|Select|Wrap|Line Numbers
  1. <input type="Submit" value="View Report" class="button" name="submit"  >
  2.     <!--- onclick="MM_openBrWindow('','','toolbar=yes,scrollbars=yes,  width=910,height=600')" --->

and finally the end tag and if statement to call a function:

Expand|Select|Wrap|Line Numbers
  1. </cfform>    
  2.  
  3. <cfif isdefined("form.Submit")>
  4.    <cfinvoke component="ScholasticObjects.importExport" method="Report">
  5.         <cfinvokeargument...>
  6.    </cfinvoke>
  7. </cfif>

This function creates my report. I want my report to be open in a new window (you can see the commented onclick inside the button) but I have the button outside the <cfif> so it opens my report on the same window. Do you guys have any idea how I can make it work. I appreciate your comments.
acoder's Avatar
acoder
Site Moderator
11,740 Posts
March 13th, 2008
03:39 PM
#2

Re: ColdFusion Function and JavaScript
Use the form target attribute. Set it to the name of the popup window.

Just a note that target is deprecated, so it will not pass strict validation, but you can use a transitional doctype instead.

Reply
cfmx2008's Avatar
cfmx2008
Member
36 Posts
March 13th, 2008
04:41 PM
#3

Re: ColdFusion Function and JavaScript
Quote:
Use the form target attribute. Set it to the name of the popup window.

Just a note that target is deprecated, so it will not pass strict validation, but you can use a transitional doctype instead.



Ohhhhhh Daaaa. Thanks so much. It works!

Reply
cfmx2008's Avatar
cfmx2008
Member
36 Posts
March 13th, 2008
05:12 PM
#4

Re: ColdFusion Function and JavaScript
Quote:
Ohhhhhh Daaaa. Thanks so much. It works!



What about my new window's attribute?

Reply
acoder's Avatar
acoder
Site Moderator
11,740 Posts
March 14th, 2008
09:38 AM
#5

Re: ColdFusion Function and JavaScript
Create the popup window with a name and then use that name in the target.

Reply
Reply
Not the answer you were looking for? Post your question . . .
190,474 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Coldfusion Forum Contributors