Two suggestions:

1. It looks like there is no space between the <option tag start and the
"selected" key word. The HTML is probably there, just not getting
rendered as <optionSelected is not a valid tag.

2. Try selected="true"... Its slightly more standards compliant.
Probalby not the issue though. 


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 20, 2007 2:57 PM
To: CF-Talk
Subject: Re: Loop and Select not working right

In the DB, it is just a varchar field.

On 2/20/07, Ben Doom <[EMAIL PROTECTED]> wrote:
>
> If what is coming from the DB is a datetime object, it won't match a 
> formatted string.  If your timelist contains things like "8:15", try 
> making your compare something more like:
>
> timeformat(getElectionProcedure1Ret.StartTime, "h:mm") eq i
>
> Or course, modify the time format to fit your data.
>
> --Ben Doom
>
> Bruce Sorge wrote:
> > I am looping though a list that outputting that into a select 
> > control
> (this
> > is the JS and code that Charlie sent me last week. Thanks Charlie). 
> > The
> loop
> > works fine as does the select, but when I go to the edit page where 
> > I
> want
> > to select the item in the list that is in the database, it is not
> working.
> > This should really be no different than outputting a query to 
> > populate
> the
> > list, right? Here is the code below:
> > <cfoutput>
> >  <select name="startTime" id="startTime" onchange="changeEndTime( 
> > this.selectedIndex);">
> >           <cfloop list="#timelist#" index="i">
> >             <option<cfif getElectionProcedure1Ret.StartTime IS
> > i>Selected</cfif>>#i#</option>
> >           </cfloop>
> >        </select>&nbsp;
> > </cfoutput>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270226
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to