If the url variable is not defined, the code will fail when it tries
to reference it in the second conditional so you either need to
cfparam the variable, or nest an cfif
<cfif IsDefined ("url.variable22")>
<cfif #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>
</cfif>
On Mon, Sep 26, 2011 at 8: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:5634
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm