Not sure the code looks fine, you could try doing a cfdump before the cfif
to see the values.

Also I don't know where people are learning this behaviour

<cfif IsDefined ("url.variable22") AND #url.variable22# EQ "OEX" OR
#url.variable22# EQ "RT">

But #'s are used to output, so the correct way to write this is

<cfif IsDefined ("url.variable22") AND url.variable22 EQ "OEX" OR
url.variable22 EQ "RT">

Also it might be easier to write the code like this instead of isDefined

<cfif structKeyExists(url, 'variable22) and url.variable22 eq "OEX" or
url.variable22 eq "RT"

One last thing you could also do, but you can confirm this with a cfdump, is
to put trim() around you variables to remove any whitespace, for example.

<cfif structKeyExists(url, 'variable22) and trim(url.variable22) eq "OEX" or
trim(url.variable22) eq "RT"

As you don't say why it is not working, is it just not comparing, or is it
throwing an exception? I am going to assume it is failing the condition
check, but you can do this right before your cfif

<cfdump var="#url#" /><cfabort />

And see what is inside the variables is indeed what you expect or not.



On Tue, Sep 27, 2011 at 1:53 PM, Mo Lay <[email protected]> wrote:

>
> Hi Guys ,
> i am trying  to get one of the dropdown DDL1 or DDL2 based on the url
> parameter passed here ..
> it does not give me what i want :
>
>
> the URL can get one of the 6 values :
>
> if URL url.variable22 = "OEX" or "RT" i should  see the
>
> <cfoutput query="q1">
> <option value="#ID#">#ITEM#</option>
> </cfoutput>
>
> for URL url.variable22 = everything else :
>
> <option value="" selected="selected"></option>
> <cfoutput query="q2">
> <option value="#ID">#ITEM#</option>
> </cfoutput>
>
>
> here is my code :
>
> <select name="Select1">
>
> <cfif IsDefined ("url.variable22") AND #url.variable22# EQ "OEX" OR
> #url.variable22# EQ "RT">
>
>                      <option value="" selected="selected">DDL1</option>
>                      <cfoutput query="q1">
>                      <option value="#ID#">#ITEM#</option>
>                      </cfoutput>
>
>                      <cfelse>
>
>                      <option value="" selected="selected">DDL2</option>
>                      <cfoutput query="q2">
>                      <option value="#ID">#ITEM#</option>
>                      </cfoutput>
>
>                     </cfif>
> </select>
>
>
> thoughts !!
>
>
> thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5633
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to