CFFORM method=GET behaves differently in CFMX6.1 than in CF 8 ?
Hi Everyone,
My organization is in the process of testing applications for a move from CFMX6.1 to CF8, however, we've found there appears to be a difference between the way CFMX6.1 and CF8 handle the GET method in a CFFORM tag.
I'm not quite sure why our developers would have used the "GET" instead of "POST" to begin with. In the application I'm currently testing, I've found that all but one of the 50+ occurrences of "GET" can be changed to "POST" without issue. However, I am a little concerned with the many other apps we have and the amount of testing that would be required.
Here's what's happening:
CFMX6.1: An appended query string parameter is always part of the submitted url whether the ACTION is POST or GET.
CF 8: A query string parameter appended to a url in the ACTION attribute will be part of the submitted url when the METHOD is POST but not when the METHOD is GET.
To see the above mentioned difference, execute the example code below in both CFMX6.1 and CF8. While executing in CFMX6.1, you will notice when the NEXT button is pressed, the myTestParameter=123 parameter is present in the browsers address bar and the variable will be accessible in the resulting page. This will not be the case when running in CF8
<h3>Test CFFORM POST vs. GET (CFMX6.1 vs. CF 8)</h3>
<cfoutput>
<table>
<cfform method="get" action="/Bayerah/gettest.cfm?myTestParameter=123" >
<input type="hidden" name="mytestFormVariable" value="abc">
<tr>
<td>
The CFform tag which is displaying this text contains action="#CGI.Path_Info#?myTestParameter=123"
<br /><br />
<strong>CF 8</strong><br />
<p>
The query string parameter "myTestParameter=123" will be part of the url when the
METHOD is POST and the form is submitted but not when METHOD is GET
</p>
<br />
<strong>CFMX6.1</strong><br />
<p>
The query string parameter "myTestParameter" displays with both POST and GET
</p>
<br/><br />
Press Next to submit the form...
</td>
</tr>
<tr>
<td>
<input type="submit" value="Next">
</td>
</tr>
</cfform>
</table>
</cfoutput>
Thanks in advance.
