Hi all,

I've used all the suggestions from this list but I still can't get it to work. I've included my code. I've also left in the code that I'm using to test.

Basically what I want to happen is this.

The file is loaded but the <cfquery I don't want to run unless some text is entered in the <input box and the "Jump" button is clicked. The file reloads itself but this time runs
the <cfquery. The cfquery get run ONLY if text is entered in the <input and ONLY then.

Help please....

<cfparam name="tempVar" default="">

<!--- Dump Session Variables
<cfdump var="#session#">
--->

<!--- check if form.redirect was passed --->
<cfif IsDefined("form.redirect") is "True">
<!--- check if form.redirect is not blank --->
<cfif form.redirect is not "">
<!--- if not, set redirect to value of form.redirect --->
<cfset redirect = form.redirect>
TEXT WAS ENTERED IN THE <input> FIELD. RUN THE <cfquery>
<cfelse>
NO TEXT ENTERED. IGNORE THE <cfquery>
</cfif>
</cfif>
</cfoutput>

<cfif isdefined("redirect")>
<cfquery name="qRedirect" datasource="interface_alias">
SELECT      *
FROM        alias
WHERE env_var = '#redirect#'
</cfquery>

<!--- Get the strShowMe results --->
<cfquery name="qGetData" datasource="interface_prefs">
SELECT strShowMe
FROM tblProfiles
WHERE strUsername = '#auth#'
</cfquery>

<cfif qredirect.recordcount>
<cfif FindNoCase(redirect,qGetData.strShowMe,1)>
<cflocation url=""> <cfelse>
<cfset request.errlookup = "You must select the directory [ #redirect# ] in your preferences before it can be viewed.">
</cfif>
<cfelse>
<cfset request.errlookup = "The directory [ #redirect# ] does not exist or the alias has to be added to the database.<br>Contact the <a href=''>
Administrator</a>">
</cfif>
</cfif>

<table cellpadding="0" cellspacing="0" border="0">
<tr align="left">
<td>

<cfoutput>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<cfform action="" method="GET" name="redirect">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>&nbsp;&nbsp;<input class="formfield" type="text" name="redirect" value="" size="8" maxlength="15" class="dirlinks"></td>
<td align="right"><input class="formbuttons" type="hidden" name="defined" value=""><input class="formbuttons" type="submit" value="Jump" class="dirlinks"
name="results"></td>
</tr>
</table>
</td>
</tr>
</cfform>
</table>
</cfoutput>
</td>




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

Reply via email to