Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I've run into this problem before also.
The solution is to move your cfform tags outside of your cflayout tags. Hope this helps.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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