IsBoolean

Returns True if value can be converted to a Boolean; otherwise, False. ColdFusion considers the terms "True," "False," "Yes," and "No" and all integer and floating point values to be Boolean values.

See also IsNumeric and YesNoFormat.

Syntax

IsBoolean(value)
value

Any number or string.

Examples

<!--- This example shows the use of IsBoolean --->
<HTML>
<HEAD>
<TITLE>
IsBoolean Example
</TITLE>
</HEAD>

<BODY bgcolor=silver>
<H3>IsBoolean Example</H3>

<CFIF IsDefined("FORM.theTestValue")>
    <CFIF IsBoolean(FORM.theTestValue)>
    <H3>The expression <CFOUTPUT>#FORM.theTestValue#</CFOUTPUT> 
      is Boolean</H3>
    <CFELSE>
    <H3>The expression <CFOUTPUT>#FORM.theTestValue#</CFOUTPUT> 
      is not Boolean</H3>
    </CFIF>
</CFIF>

<FORM ACTION="isBoolean.cfm" METHOD="POST">
<P>Enter an expression, and discover if
it can be evaluated to a Boolean value.

<INPUT TYPE="Text" NAME="TheTestValue" VALUE="1">
<INPUT TYPE="Submit" VALUE="Is it Boolean?" NAME="">
</FORM>
</BODY>
</HTML>