Copy link to clipboard
Copied
Good morning,
I know I should try this before posting but, is this possible?
<cfif Not IsDefined = "#FORM.TagNumber#">
<cflocation url = "holds.cfm">
</cfif>
Does this make any sense?
Thanks in Advance,
DJ Khalif
This is my cfparam:
<cfparam name="#FORM.ORDNO#">
This is my cflocation:
<cfif IsDefined("#FORM.ORDNO#")>
<cflocation url="/index.cfm">
<cfelseif Not IsDefined("#FORM.ORDNO#")>
<cflocation url="/testpages/testurlholds.cfm">
</cfif>
Cfparam has nothing to do with it. You twice repeated the mistake I pointed out. Use the variable name, that is, without the # symbol. Also, give the variable in cfparam a default value. Something like this
This is my cfparam:
<cfparam name="FORM.ORDNO" default="">
<cfif IsDefin
...Copy link to clipboard
Copied
<cfif Not IsDefined ("#FORM.TagNumber#")>
<cflocation url = "holds.cfm">
</cfif>
<cfouput>#FORM.TagNumber#</cfoutput>
Ok,
This does not work. I'll get back later.
Copy link to clipboard
Copied
<cfif Not IsDefined("FORM.TagNumber")>
<cflocation url = "holds.cfm">
</cfif>
It's about the name of the variable, not the value.
Copy link to clipboard
Copied
This is my result:
Element ORDNO is undefined in FORM.
This is my query:
<cfquery name="rsORDNOSearch" datasource="atDat">
SELECT AMFLIBQ.ORDNO, AMFLIBQ.FITEM, CD_COMDTA.LPITEM, CD_COMDTA.LPSTAT, CD_COMDTA.LPMODL
FROM AMFLIBQ INNER JOIN CD_COMDTA ON AMFLIBQ.FITEM = CD_COMDTA.LPITEM
WHERE AMFLIBQ.ORDNO LIKE 'M%#FORM.ORDNO#0' AND CD_COMDTA.LPSTAT = 'A'
</cfquery>
This is my cfparam:
<cfparam name="#FORM.ORDNO#">
This is my cflocation:
<cfif IsDefined("#FORM.ORDNO#")>
<cflocation url="/index.cfm">
<cfelseif Not IsDefined("#FORM.ORDNO#")>
<cflocation url="/testpages/testurlholds.cfm">
</cfif>
Could my cflocation be too far down in the page? It comes after the query but before my form.
Copy link to clipboard
Copied
I was trying this with too much information but, I searched some more and found this to work.
<cfif IsDefined("FORM.ORDNO")>
<cfelse>
<cflocation url="/Production/workordersearch2.cfm">
</cfif>
This way no can open the production page in error.
Copy link to clipboard
Copied
Better still would be:
<cfif NOT IsDefined("FORM.ORDNO")>
<cflocation url="/Production/workordersearch2.cfm">
</cfif>
Copy link to clipboard
Copied
BKBK and Dave,
Thanks for the help. BKBK, I tried to use your method but, I kept using <cfparam>, which caused more problems than, solutions. Once I took it out, it work but by that time I added <cfelse>. As long as it worked, I was happy. I may decide to rid code of that <cfelse>, later.
Thanks again,
DJ Khalif
Copy link to clipboard
Copied
This is my cfparam:
<cfparam name="#FORM.ORDNO#">
This is my cflocation:
<cfif IsDefined("#FORM.ORDNO#")>
<cflocation url="/index.cfm">
<cfelseif Not IsDefined("#FORM.ORDNO#")>
<cflocation url="/testpages/testurlholds.cfm">
</cfif>
Cfparam has nothing to do with it. You twice repeated the mistake I pointed out. Use the variable name, that is, without the # symbol. Also, give the variable in cfparam a default value. Something like this
This is my cfparam:
<cfparam name="FORM.ORDNO" default="">
<cfif IsDefined("FORM.ORDNO")>
<cflocation url="/index.cfm">
<cfelse>
<cflocation url="/testpages/testurlholds.cfm">
</cfif>
Copy link to clipboard
Copied
BKBK,
Thanks again. I did drop the cfparam and have accomplished my goal. I may go back to it later.
Thanks again,
DJ Khalif
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more