ParameterExists

Description

Returns True if the specified parameter has been passed to the current template or has already been created during execution of the current template. Otherwise returns NO.

This function is provided for backward compatibility with previous versions of ColdFusion. You should use the function IsDefined instead.

Category

Decision functions

Syntax


ParameterExists(parameter) 

See also

GetClientVariablesList, IsDefined

Parameters

Parameter
Description
parameter
A syntactically valid parameter name.

Example

<!--- This example shows ParameterExists --->

<html>

<head>

<title>

ParameterExists Example

</title>

</head>



<body bgcolor = silver>

<H3>ParameterExists Example</H3>



<cfif ParameterExists(FORM.myString)>

<P>Using ParameterExists, we have shown that the FORM

field "myString" now exists. However, this function is

provided for backward compatibility and

the function IsDefined should be used instead, as below.

</cfif>



<cfif IsDefined("FORM.myString")>

<P>Because the variable FORM.myString has been defined, we

can now show its contents. This construction allows us

to place a form and its resulting action template in the same

template, while using IsDefined to control the

flow of template execution.

<P>The value of "FORM.myString" is 

 <B><I><cfoutput>#FORM.myString#</cfoutput></I></B>

<cfelse>

<P>During the first time through this template, the variable

"FORM.myString" has not yet been defined, so we 

are not attempting to evaluate it.

</cfif>

...



Banner.Novgorod.Ru