CFLib.org – Common Function Library Project

Form2QS()

Last updated June 26, 2002

author

Billy Cravens

Version: 1 | Requires: CF5 | Library: DataManipulationLib

Description:
Creates a standard query string (list of name value pairs, separated by =, delimited by &) from all of the form variables.

Return Values:
Returns a string.

Example:

<cfset form.foo = 1>
<cfset form.goo = "Jacob Camden">
<cfoutput>foo.cfm?id=1#form2qs()#</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * Converts form variables to query string.
 * Modified by RCamden
 * 
 * @return Returns a string. 
 * @author Billy Cravens (billy@architechx.com) 
 * @version 1, June 26, 2002 
 */
function form2qs() {
	var str = "";
	var field = "";
	for(key in form) {
		str = str & "&#key#=" & urlEncodedFormat(form[key]);
	}
	return str;	
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson