ColdFusion Function and JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cfmx2008
    New Member
    • Jan 2008
    • 36

    #1

    ColdFusion Function and JavaScript

    Hi everyone,

    I have a coldfusion form (ReportMenu.cfm ) that the action page is itself as below:
    [CODE=cfm]<cfform action="/cfreport/ReportMenu.cfm" method="POST" enctype="multip art/form-data">
    [/CODE]
    and it's button:

    [CODE=cfm]<input type="Submit" value="View Report" class="button" name="submit" >
    <!--- onclick="MM_ope nBrWindow('','' ,'toolbar=yes,s crollbars=yes,w idth=910,height =600')" --->
    [/CODE]
    and finally the end tag and if statement to call a function:

    [CODE=cfm]</cfform>

    <cfif isdefined("form .Submit")>
    <cfinvoke component="Scho lasticObjects.i mportExport" method="Report" >
    <cfinvokeargume nt...>
    </cfinvoke>
    </cfif>
    [/CODE]
    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.
    Last edited by acoder; Mar 13 '08, 03:35 PM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    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.

    Comment

    • cfmx2008
      New Member
      • Jan 2008
      • 36

      #3
      Originally posted by acoder
      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!

      Comment

      • cfmx2008
        New Member
        • Jan 2008
        • 36

        #4
        Originally posted by cfmx2008
        Ohhhhhh Daaaa. Thanks so much. It works!

        What about my new window's attribute?

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Create the popup window with a name and then use that name in the target.

          Comment

          Working...