Skip to main content
Participant
October 18, 2010
Question

CFLAYOUT and Form's target

  • October 18, 2010
  • 2 replies
  • 1431 views

I just setup a border layout for my page, here's some code:

<cflayout type="border">
         <cflayoutarea position="top" size="80" align="right">
             <p>
                 <cfform name="logMeout" action="#CGI.script_name#" method="post" target="_top"> 
                       <cfinput type="submit" name="logout" value="Logout" />
                   </cfform>
               </p>
        </cflayoutarea>

...

...

When I click that button, the logout page displays in the top bar.

What I want is to display the page in the window, I mean, reload the entire http page.

I tried target _top but it does not work. So what?

This topic has been closed for replies.

2 replies

Participant
April 3, 2012

This worked for me...

CFForm does something strange to the form code on submit.  Make the type of the submit to 'button' and add javascript to submit the form.  I have included the fix below.

<cflayout type="border">

         <cflayoutarea position="top" size="80" align="right">

             <p>

                 <cfform name="logMeout" action="#CGI.script_name#" method="post" target="_top"> 

                       <cfinput type="button" name="logout" value="Logout" onClick="javascript:document.logMeout.submit()"/>

                   </cfform>

               </p>

        </cflayoutarea>

Dennis

Participating Frequently
October 18, 2010

Try this:

<cfform name="logMeout" id="logMeout" action="#CGI.script_name#" method="post" target="_top">  

<input type="button" 
          onclick="if (_CF_checklogMeoutForm(this.form)) {document.logMeout.submit();}" 
          value="Submit">
</cfform>

More information here:

http://samfarmer.instantspot.com/blog/2009/06/14/Submitting-a-cfform-inside-a-cfdiv-to-a-new-page