CFLib.org – Common Function Library Project

Form2QS()

Last updated June 26, 2002

Version: 1 | Requires: ColdFusion 5 | Library: DataManipulationLib

 
Rated 2 time(s). Average Rating: 4.5

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:

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

Parameters:

No arguments.

Full UDF Source:

view plain print about
<cfscript>
/**
 * 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;    
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Dave Anderson Dave Anderson added
iniToStruct
20 day(s) ago

Dave Anderson Dave Anderson added
deDupeArray
20 day(s) ago

Richard Richard added
dice
22 day(s) ago

Isaac Dealey Isaac Dealey added
getRelative
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 22 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Raymond Camden highlightAndCrop
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson