Does Len function only evaluate numerical results?

Posted by Mel on Stack Overflow See other posts from Stack Overflow or by Mel
Published on 2010-03-11T18:39:39Z Indexed on 2010/03/11 18:44 UTC
Read the original article Hit count: 221

Filed under:
|
|
|

Why does the following code not output "Error" if the form is submitted with a blank field? Does Len only evaluate numerical values?

<cfif NOT Len(Trim("Form.myField"))>
 <cfoutput>Error</cfoutput>
</cfif>

The following also does not evaluate as expected:

<cfif Len(Trim("Form.myField")) IS 0>
 <cfoutput>Error</cfoutput>
</cfif>

HTML:

<input type="text" name="myField" value="">

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about trim