Returns TRUE if value can be converted to a Boolean; otherwise, FALSE.
IsBoolean(value)
| Parameter |
Description |
|---|---|
| value |
A number or string |
<!--- 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>#DE(FORM.theTestValue)#</cfoutput>
is Boolean</H3>
<cfelse>
<H3>The expression <cfoutput>#DE(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>