Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
alecken #1
Selected is not working!!! help please!
The item on my drop down list is not selected correctly and all show the first
item.
Is this because I use <cfloop query=""> instead of <cfoutput query="">
surrounding the select tags?
I can't use 2 <cfoutput> nested within each other since it will generates
error that's why I'm using <cfloop> instead.
Otherwise why this code does not work??? it seems so simple, please help!
<select name="InfoList">
<cfloop query="getAllInfo">
<option value="#InfoID#" <cfif #Bgs.Info# EQ
#getAllInfo.InfoID#>Selected</cfif>>#Name# <<<< this always select 1st item
</cfloop>
</select>
HERE IS THE BIGGER PICTURE:
<cfquery name="Bgs" datasource="wbt">
Select * From BgTr <cfif IsDefined("url.lc")> where AppID =
#URL.Lc#</cfif>
</cfquery>
<cfoutput query="Bgs">
alecken Guest
-
#38816 [Opn]: PHP code that was working perfectly recently stopped working.
ID: 38816 User updated by: mtoohee at gmail dot com -Summary: PHP code that was working perfectly recently stopped.... -
selected= not working in cfselect
I am working on my admin interface for a department and I need to have a cfselect actually hilight the value that is passed from a query (like it is... -
Macromedia Flash Player installed and working properly suddenlys stops working..
No idea what has caused the Flash player to stop working. This is not my machine but a relatives who has asked for help over the T'giving... -
#25474 [NEW]: posting arrays from a multiply selected select box not working properly
From: fmuller at cisco dot com Operating system: redhat 7.3 PHP version: 4.3.3 PHP Bug Type: *Web Server problem Bug... -
Eraser tool not working when brush or pencil mode is selected.
After I upgraded to Windows Photoshop seven. I have not been able to get the eraser tool to work in any other way except in block format. I know... -
Dan Bracuk #2
Re: Selected is not working!!! help please!
Since you didn't specify a row number for getAllInfo here:
<cfif #Bgs.Info# EQ #getAllInfo.InfoID#>
you always get the first record. By the way, you don't need octothorps inside a cfif tag.
Dan Bracuk Guest
-
alecken #3
Re: Selected is not working!!! help please!
Hi!
Row number? can you provide example? I always do like what I did without row number and never had problem.
alecken Guest
-
Dan Bracuk #4
Re: Selected is not working!!! help please!
this
<cfif #Bgs.Info# EQ #getAllInfo.InfoID#>
should be this
<cfif Bgs.Info EQ getAllInfo.InfoID[currentrow]>
Originally posted by: alecken
Hi!
Row number? can you provide example? I always do like what I did without row
number and never had problem.
Dan Bracuk Guest
-
reenaroy #5
Re: Selected is not working!!! help please!
Hi Alecken,
Instead of using this ..
<select name="InfoList">
<cfloop query="getAllInfo">
<option value="#InfoID#" <cfif #Bgs.Info# EQ
#getAllInfo.InfoID#>Selected</cfif>>#Name# <<<< this always select 1st item
</cfloop>
</select>
use this .............
<cfset BgsInfo=trim(Bgs.Info)>
<cfset getAllInfoInfoID=trim(getAllInfo.InfoID)>
<select name="InfoList">
<cfloop query="getAllInfo">
<option value="#getAllInfo.InfoID#" <cfif BgsInfo EQ
getAllInfoInfoID>Selected</cfif>>#getAllInfo.Name# </option>
</cfloop>
</select>
reenaroy Guest



Reply With Quote

