Bushy,
You have to scope the variable.  Your form is "GET" so your variables will
be on the URL.  If your form was "POST" the variable would be "form.defined"

You should probably give the field a value too -- some browsers may not pass
fields without values.

<cfif NOT IsDefined("url.defined")>
  Not Defined
<cfelse>
  Defined
Run <cfquery....
</cfif>

<form action="" method="GET" name="redirect">
<input class="formfield" type="text" name="redirect" value="" size="8"
maxlength="15">
<input class="formbuttons" type="hidden" name="defined" value="yes"><input
class="formbuttons" type="submit" value="Jump" name="results">
</form>

-----Original Message-----
From: Bushy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 9:52 AM
To: CF-Talk
Subject: Checking <cfinput

Hi,

I have a template that reloads itself. I'm also doing a <cfquery on a
database. What I want to do is when I load this template I don't want to do
the <cfquery unless once
loaded the user enters in some text in the <input box and then submits the
page which reloads itself.

Is the syntax below correct? It always returns "Not Defined" even if I input
text into the field.

<cfif NOT IsDefined("defined")>
  Not Defined
<cfelse>
  Defined
Run <cfquery....
Set defined to NIL
</cfif>

<form action="" method="GET" name="redirect">
<input class="formfield" type="text" name="redirect" value="" size="8"
maxlength="15">
<input class="formbuttons" type="hidden" name="defined" value=""><input
class="formbuttons" type="submit" value="Jump" name="results">
</form>




[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to