Skip to main content
Inspiring
September 8, 2009
Answered

<cflocation url="">

  • September 8, 2009
  • 1 reply
  • 1800 views

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 topic has been closed for replies.
    Correct answer BKBK

    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.


    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>

    1 reply

    djkhalifAuthor
    Inspiring
    September 8, 2009

    <cfif Not IsDefined ("#FORM.TagNumber#")>

    <cflocation url = "holds.cfm">

    </cfif>

    <cfouput>#FORM.TagNumber#</cfoutput>

    Ok,

    This does not work. I'll get back later.

    BKBK
    Community Expert
    Community Expert
    September 8, 2009

    <cfif Not IsDefined("FORM.TagNumber")>

    <cflocation url = "holds.cfm">

    </cfif>

    It's about the name of the variable, not the value.

    djkhalifAuthor
    Inspiring
    September 8, 2009

    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.