Sagewire Logo

3 Message(s) by 3 Author(s) originally posted in cfml discussion


From: Adam Cameron Date:   Saturday, October 27, 2007
You are confusing the notion of a variable "being defined", and a variable
"having a value".

Form variables - with the exception of unchecked checkboxes - are always
*defined*, but they might not have a value. Well: strictly speaking as ColdFusion
is loosely-type d, they *do* have a value: an empty string.

So waht you need to test for isn't whether your input variable is defined
- it always will be - but whether it has a non-zero-length-string value.

So ask yourself the question: "how does one check the length of a string?"

--
Adam


From: swap_18 Date:   Saturday, October 27, 2007
I am using ColdFusion 8 to develop forms. I need to check if user has entered
a value of type "text". If not then a message has to Cfoutput. I am using the
following code:

<CFIF not isdefined("form.question")>
<CFOUTPUT> Enter question
</CFOUTPUT>

</CFIF> The problem is even f nothing is entered in the Question Field, the message
Enter question isn't being displayed. Its as is the <CFIF not
isdefined("form.question")>
isn't at all being recognised.
I also tried <CFIF not isdefined("form.question_now")>

Please help.


From: jason Date:   Sunday, October 28, 2007
I personally always check
<CFIF isdefined("form.item") AND #form.item# NEQ "">

spose you can also do a Len() check.

Regards

Jay



Next Message: How to get the list element when # is the delimiters??


Blogs related to

The World Of World Of WarCraft
Note, ColdFusion will need to be running on the server.Once this is done, the following XML data will be returned, as there is a lot of data I am going to break it down step by step. The first thing you’ll notice is the entire XML sheet ...

Web Page Syntax Highlighting for ColdFusion - Brush for ...
I have been working on a implementing a solution to highlight ColdFusion code snippets when they are being posted on your web site/blog. Highlighting the code according to the appropriate language can make it much easier to read and ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional