Well, this is interesting. I set up a very simple set of pages.
Test.cfm
cflayout type="tab">
<cflayoutarea name="test" title="Test">
<cfform action="testResponse.cfm" method="post">
<cfinput type="text" name="test" size="10">
<input type="submit" />
</cfform>
</cflayoutarea>
</cflayout>
testResponse.cfm
<cfparam name="FORM.test" default="">
<cfoutput>#FORM.test#</cfoutput>
<cflocation url="testTarget.cfm?show=#FORM.test#">
testTarget.cfm
<cfparam name="URL.show" default="">
<cfoutput>#URL.show#</cfoutput>
<p>I came here</p>
When I enter some value in the input the program does indeed return to test.cfm
and my tab but prints everything from testTarget.cfm
The issue seems to be in how the <form> tag is processed by CF. I set up
another file, test2, using <form> tags instead of <cfform>
When you use <cfform> it's translated to:
<form name="CFForm_1" id="CFForm_1" action="testResponse.cfm" method="post"
onsubmit="return ColdFusion.Ajax.checkForm(this, _CF_checkCFForm_1,'test')">
Using <form> there is no translation/processing. It looks like the culprit is
the "onsubmit" statement. It works differently than
ColdFusion.Ajax.submitForm(). The callback function for
ColdFusion.Ajax.submitForm() returns everything on the target page including
tags, header info, etc. where this is showing only what I actually output - but
back into the <cflayout> area.
And this is where it **really** gets weird: Run the code (test.cfm not
test2.cfm) and what I see on the screen is my "test" tab and what I output in
testTarget.cfm - I see no input box or submit button. BUT, if you view the code
it's identical to the code before you do the submit. So where are the form
elements?
Some Ajax guru needs to help with this and tell us how you handle this. (I
suppose one possibiity is to never actually use a submit button but handle it
all with ColdFusion.Ajax.submitForm(). )
Larry Stephens
-----Original Message-----
From: Joe None [mailto:[email protected]]
Sent: Friday, September 17, 2010 2:20 PM
To: cf-talk
Subject: Re: cfform issue within cflayout - cflayoutarea
Yes I do.
> Just curious - do you end your processing page with <cflocation> ?
>
> Larry Stephens
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337229
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm