View Single Post
  #2 (permalink)  
Old Apr 18th, 2008, 05:27
uday uday is offline
New Member
Join Date: Dec 2007
Location: India
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: ColdFusion - Using listboxes - Need Help!

Hi Dear

instead of using variables.gender use simply datasourcename.gender and as far as concern of cfoutput it is only for display purposes. so in your case you use or not it does not effect on your list box.

so your code will become

<select name="Gender">
<option value="Male" <cfif actor.Gender IS 'Male'>Selected</cfif>>Male</option>
<option value="Female" <cfif actor.Gender IS 'Female'> Selected</cfif>>Female</option>
</select>

but be careful, your recordset should be return only and only one record.

enjoy
Reply With Quote