Skip navigation
fabio.bozzo
Currently Being Moderated

CFLAYOUT and Form's target

Oct 18, 2010 8:08 AM

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?

 
Replies
  • Currently Being Moderated
    Oct 18, 2010 12:20 PM   in reply to fabio.bozzo

    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-i nside-a-cfdiv-to-a-new-page

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 1:45 AM   in reply to fabio.bozzo

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points