Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFLAYOUT and Form's target

New Here ,
Oct 18, 2010 Oct 18, 2010

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?

TOPICS
Advanced techniques
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2010 Oct 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2012 Apr 03, 2012
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources