I am using cold fusion 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 is not being displayed. Its as is the <cfif not isdefined("form.question")> is not at all being recognised.
I also tried <cfif not isdefined("form.question_now")>
Please help.
<cfif isdefined is not working
Started by swapna, Oct 27 2007 01:43 PM
1 reply to this topic
#1
Posted 27 October 2007 - 01:43 PM
|
|
|
#2
Posted 27 October 2007 - 02:04 PM
Hey there,
Try this:
<cfif not isdefined("form.question") OR #form.question# EQ "">
<cfoutput>Enter question</cfoutput>
</cfif>
Your problem is when the form is submitted the question variable is defined, but it is set to an empty string.
Sincerely,
Travis Walters
Try this:
<cfif not isdefined("form.question") OR #form.question# EQ "">
<cfoutput>Enter question</cfoutput>
</cfif>
Your problem is when the form is submitted the question variable is defined, but it is set to an empty string.
Sincerely,
Travis Walters
spammy sig deleted


Sign In
Create Account

Back to top









