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 开发者_Python百科as expected:
<cfif Len(Trim("Form.myField")) IS 0>
 <cfoutput>Error</cfoutput>
</cfif>
HTML:
<input type="text" name="myField" value="">
Because it's evaluating the literal string "Form.myField", which is not length 0.
Try: <cfif len(trim(form.myField)) EQ 0>
are you sure you're supposed to pass in the parameter in quotes within the trim function? it may be literally trimming the string "Form.myField"
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论