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

cflayout, cflayoutarea and cfform - can't use target _parent?

Guest
Jul 30, 2010 Jul 30, 2010

CF9 - I'm using a cflayoutarea within cflayout, then inside of that I have a cfform for login. When I submit my cfform it loads my login page (submitted) inside of the cflayout window, which I don't want. I've tried using target _blank, _parent, etc but it changes nothing. If I use plain old form instead of cfform with target _parent, it works fine. So does something within cfform clash with cflayout or cflayoutarea that I don't know about?

2.3K
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
Guest
Sep 16, 2010 Sep 16, 2010

I'm bumping my own thread because I left this alone for awhile but want to revisit.

<cflayout name="articleManagement"...>

<cflayoutarea name="tabAdd" source="mysourcefile.cfm" title="blah">

<cfform action="myactionpage.cfm" method="post" name="mypage">

...

</cfform>

</cflayoutarea>

</cflayout>

cfform processes myactionpage.cfm and hits the cflocation at the end of the processing page, it loads mysourcefile.cfm back into my cflayout articleManagement which shows one form on top of the other. My cflocation should direct it to the main page that holds the cflayout.

Is there a way to break out of cflayout/cflayoutarea when using cfform? Using a regular form tag does not have this problem but I like using the cfform validation.

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
Community Beginner ,
Oct 07, 2010 Oct 07, 2010

I've run into this problem before also.

The solution is to move your cfform tags outside of your cflayout tags.  Hope this helps.

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
Guest
Oct 08, 2010 Oct 08, 2010

Good point, I'll keep that in mind down the road. Unfortunately I'm using cflayoutarea with the source attribute that calls a page (or pages for more than one cflayoutarea) and inside of the source pages are the cfforms, so they can't be moved outside. I'll just consider the cflayoutarea a feature I can use in some cases.

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

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
Community Beginner ,
Mar 13, 2013 Mar 13, 2013
LATEST

I'm not going to create a new thread because my question is actually the same as what was asked in here.

By following the answer from djeter3, I also use onClick="javascript:document.logMeout.submit()" but I use a different form name. Although my form got submitted but the form validation did not work.

The purpose of me using CFFORM is to use the form field validation ability. Now that my cfform tags reside within cflayout or cflayoutarea the form validation is not working!!

By the way, I'm using CF8

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